#536 Global Cooldown Tracking in API currently impossible in-combat despite being part of the Retail API functionality.

Status: Awaiting review · Area: UI & Interface · Addons & API

Cooldown values are secret in combat, so add-ons cannot read the remaining global cooldown and GCD timers become inaccurate.

Current behavior

At present, it is impossible to poll the remaining GCD in combat, which has downstream effects for add-ons. The only current option is to start a timer when we detect a `SPELL_UPDATE_COOLDOWN` event in accordance with the expected GCD from the spell ID, but there is considerable variance in when these events are picked up by the client relative to when the GCD actually started, often at the levels of hundreds of milliseconds depending on a player's connection to the world.

Expected behavior

The only reference point for the new secrets API is the retail client, where there exists a dummy spell `61304` for the Global Cooldown. As of Dec 25 this is explicitly has a non-secret cooldown value: - https://warcraft.wiki.gg/wiki/Patch_12.0.0/API_changes/notes As such on retail, an add-on can notice the `SPELL_UPDATE_COOLDOWN` and then poll this spell's cooldown to find the real time remaining on GCD for accurate information. This spell does not exist in classic, where we typically use the TEST Scorch spell `29515` to poll for GCD information, but this spell's cooldown values are secret in combat. Can this or some other spell be whitelisted or some other query exposed for GCD info in the Forever client?

How to reproduce

1. Out of combat, cast any spell that incurs a GCD and run


lua
/run local i=C_Spell.GetSpellCooldown(29515); if i then print("Active:",i.isActive,"Start secret:",issecretvalue(i.startTime),"Duration secret:",issecretvalue(i.duration)) end


We get `Active: true  Start secret: false  Duration secret: false`

2. Repeat the same while in combat and we get `Active: true  Start secret: true  Duration secret: true`

3. To demonstrate the GCD dummy spell is unavailable:


lua
/run for _,id in ipairs({61304,29515}) do local s=C_Spell.GetSpellInfo(id); print(id,C_Spell.DoesSpellExist(id),s and s.name) end


We get `61304 false nil and 29515 true TEST Scorch`