Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:GetAbilityCooldown

From RoR Wiki
Revision as of 19:42, 16 October 2026 by Maintenance script (talk | contribs) (UI Lua API import (WAR 1.4.8))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

UI Lua API · Ability functions
Version: WAR 1.4.8

Returns the cooldown of an ability for the player, in milliseconds.

cooldown = GetAbilityCooldown(abilityId)

Arguments

abilityId
number – Id of the ability. It is converted to a 16-bit integer.

Returns

cooldown
number – Cooldown in milliseconds. 0 for an unknown ability.

Details

  • The value is computed by the client for the player. A comment in easystem_tooltips/source/abilitytooltips.lua says it includes bonuses, unlike the cooldown field of GetAbilityData, which is in seconds.
  • 0 is returned when there is no player object.
  • This is the length of the cooldown, not the time left. For the time left on a hotbar slot use GetHotbarCooldown.

Errors

None besides the generic Invalid Parameters message when the argument is missing or not a number.

Example

From easystem_tooltips/source/abilitytooltips.lua:

-- Get the cooldown including potential bonuses from c instead of the value stored in abilityData.cooldown
local realCooldown = GetAbilityCooldown( abilityData.id ) / 1000
LabelSetText( windowName.."Cooldown", GetAbilityCooldownText( realCooldown ) )

See also