API GetSpellCooldown

Retrieves the cooldown data of the spell specified.

start, duration, enabled, modRate = GetSpellCooldown("spellName" or spellID or slotID, "bookType")

Arguments

 * spellName : String - name of the spell to query.

or
 * spellID : Number - ID of the spell to query.

or
 * slotID : Number - index of a spell book slot to query, integers ascending from 1.
 * bookType : String - spell book category, e.g.  ("spell") or   ("pet").

Returns

 * startTime : Number - The time when the cooldown started (as returned by GetTime); zero if no cooldown; current time if (enabled == 0).
 * duration : Number - Cooldown duration in seconds, 0 if spell is ready to be cast.
 * enabled : Number - 0 if the spell is active (Stealth, Shadowmeld, Presence of Mind, etc) and the cooldown will begin as soon as the spell is used/cancelled; 1 otherwise.
 * modRate : Number - The rate at which the cooldown widget's animation should be updated.

Example
The following snippet checks the state of Presence of Mind cooldown. On English clients, you could also use  in place of , which is the spell's ID. local start, duration, enabled, modRate = GetSpellCooldown(12043) if enabled == 0 then print("Presence of Mind is currently active, use it and wait " .. duration .. " seconds for the next one.") elseif ( start > 0 and duration > 0) then local cdLeft = start + duration - GetTime print("Presence of Mind is cooling down, wait " .. cdLeft .. " seconds for the next one.") else print("Presence of Mind is ready.") end