Is there an ability in Lua to use an item like a trinket and check if it is on cooldown.
You can use the WoW API function GetItemCooldown(itemID)
. To obtain the item ID you'd use the GetInventoryItemID("unit", InventorySlotId)
function:
local itemID = GetInventoryItemID("player", 13) -- 13 for trinket1, 14 for trinket2
local start, duration, enable = GetItemCooldown(itemID)
if enable == 1 and duration == 0 then
-- You can use the item
end