# Add Cooldown For Unit Ability
Grammar — Add inVal seconds to cooldown inCooldown on ability inAbil on unit inUnit
Flags —Native
|Action
Adds time to the specified ability cooldown link.
# Arguments
unit
— Unitstring
<gamelink::Abil> — Abilitystring
<cooldown> — Cooldownfixed
— Value
Returns — void
native void UnitAbilityAddCooldown(
unit inUnit,
string inAbil,
string inCooldown,
fixed inVal,
);
# Related
Category: Unit / Charges And Cooldowns
- Add Charge Remaining Regen Time For Unit Behavior —
void
— UnitBehaviorAddChargeRegenRemaining - Add Charge Remaining Regen Time For Unit Ability —
void
— UnitAbilityAddChargeRegenRemaining - Add Charge Remaining Regen Time For Unit —
void
— UnitAddChargeRegenRemaining - Add Charge Full Regen Time For Unit Behavior —
void
— UnitBehaviorAddChargeRegenFull - Add Charge Full Regen Time For Unit Ability —
void
— UnitAbilityAddChargeRegenFull - Add Charge Full Regen Time For Unit —
void
— UnitAddChargeRegenFull - Add Charge Used For Unit Behavior —
void
— UnitBehaviorAddChargeUsed - Add Charge Used For Unit Ability —
void
— UnitAbilityAddChargeUsed - Add Charge Used For Unit —
void
— UnitAddChargeUsed - Remove Charge Used For Unit Behavior —
void
— libNtve_gf_UnitBehaviorRemoveChargeUsed - Remove Charge Used For Unit Ability —
void
— libNtve_gf_UnitAbilityRemoveChargeUsed - Remove Charge Used For Unit —
void
— libNtve_gf_UnitRemoveChargeUsed - Charge Regen Remaining For Unit Behavior —
fixed
— UnitBehaviorGetChargeRegen - Charge Regen Remaining For Unit Ability —
fixed
— UnitAbilityGetChargeRegen - Charge Regen Remaining For Unit —
fixed
— UnitGetChargeRegen - Charge Regen Full For Unit Behavior —
fixed
— UnitBehaviorGetChargeRegenFull - Charge Regen Full For Unit Ability —
fixed
— UnitAbilityGetChargeRegenFull - Charge Regen Full For Unit —
fixed
— UnitGetChargeRegenFull - Charge Used For Unit Behavior —
fixed
— UnitBehaviorGetChargeUsed - Charge Used For Unit Ability —
fixed
— UnitAbilityGetChargeUsed - Charge Used For Unit —
fixed
— UnitGetChargeUsed - Add Cooldown For Unit Behavior —
void
— UnitBehaviorAddCooldown - Add Cooldown For Unit Ability —
void
— UnitAbilityAddCooldown - Modify Cooldown For Unit —
void
— UnitModifyCooldown - Clear Cooldowns For Unit —
void
— UnitClearCooldowns - Remove Cooldown For Unit Behavior —
void
— libNtve_gf_UnitBehaviorRemoveCooldown - Remove Cooldown For Unit Ability —
void
— libNtve_gf_UnitAbilityRemoveCooldown - Remove Cooldown For Unit —
void
— libNtve_gf_UnitRemoveCooldown - Cooldown For Unit Behavior —
fixed
— UnitBehaviorGetCooldown - Cooldown For Unit Abilty —
fixed
— UnitAbilityGetCooldown - Cooldown For Unit —
fixed
— UnitGetCooldown - Activate Ability Cooldowns —
void
— UnitAbilitySpendExplicit - Reset Ability Cooldowns —
void
— UnitAbilityReset - Ability Charge Info For Unit —
fixed
— UnitAbilityChargeInfo
# Examples
campaigns/liberty.sc2campaign — base.sc2maps/maps/campaign/tvalerian03.sc2map/MapScript.galaxy:5357
UnitAbilitySpend(gv_artifact, AbilityCommand("EnergyNova", 0), c_spendLocationAll);
libNtve_gf_UnitAbilityRemoveCooldown(gv_artifact, "EnergyNova", "Abil/Supernova");
UnitAbilityAddCooldown(gv_artifact, "EnergyNova", "Abil/Supernova", 184.0);
gv_energyNovasUsed = 0;
UnitIssueOrder(UnitFromId(285), OrderTargetingPoint(AbilityCommand("attack", 0), PointFromId(1006)), c_orderQueueReplace);
campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tvalerian03.sc2map — MapScript.galaxy:5357
UnitAbilitySpend(gv_artifact, AbilityCommand("EnergyNova", 0), c_spendLocationAll);
libNtve_gf_UnitAbilityRemoveCooldown(gv_artifact, "EnergyNova", "Abil/Supernova");
UnitAbilityAddCooldown(gv_artifact, "EnergyNova", "Abil/Supernova", 184.0);
gv_energyNovasUsed = 0;
UnitIssueOrder(UnitFromId(285), OrderTargetingPoint(AbilityCommand("attack", 0), PointFromId(1006)), c_orderQueueReplace);
mods/core.sc2mod — base.sc2data/TriggerLibs/NativeLib.galaxy:5861
// Automatic Variable Declarations
// Implementation
UnitAbilityAddCooldown(lp_inUnit, lp_inAbil, lp_inCooldown, (-1.0 * UnitAbilityGetCooldown(lp_inUnit, lp_inAbil, lp_inCooldown)));
}
mods/core.stormmod — base.stormdata/TriggerLibs/NativeLib.galaxy:4999
// Automatic Variable Declarations
// Implementation
UnitAbilityAddCooldown(lp_inUnit, lp_inAbil, lp_inCooldown, (-1.0 * UnitAbilityGetCooldown(lp_inUnit, lp_inAbil, lp_inCooldown)));
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/MapMechanicsLib.galaxy:7484
libGame_gf_SendEventMapObjectiveCapturedByUnit(EventPlayerEffectUsedUnit(c_effectUnitCaster));
libNtve_gf_UnitAbilityRemoveCooldown(libMapM_gv_mMGardensDragonStatue, "LeaveVehicle", "Abil/LeaveVehicle");
UnitAbilityAddCooldown(libMapM_gv_mMGardensDragonStatue, "LeaveVehicle", "Abil/LeaveVehicle", 5.0);
TimerPause(libMapM_gv_mMGardensDragonDragonStatueActiveReminderTimer, true);
TimerStart(libMapM_gv_mMGardensDragonDragonKnightLifeTimer, lv_duration, false, c_timeGame);
mods/heromods/firebat.stormmod — base.stormdata/LibHFIR.galaxy:161
UnitSetPosition(lv_bunkerDropPassengerUnit, UnitGetPosition(lv_bunkerDropTurretUnit), false);
UnitAbilityAddCooldown(lv_bunkerDropTurretUnit, "FirebatBunkerDropExitBunker", "Abil/FirebatBunkerDropExitBunker", 0.5);
libGame_gf_UnitSelectionEnterVehicle(lv_bunkerDropTurretUnit, lv_bunkerDropPassengerUnit, lv_bunkerDropPassengerPlayer);
libGame_gf_SendInstantEventPlayerEnteredVehicle(lv_bunkerDropPassengerPlayer, lv_bunkerDropPassengerUnit, lv_bunkerDropPassengerUnit, lv_bunkerDropTurretUnit);
mods/missionpacks/novacampaign.sc2mod — base.sc2data/LibNCMI.galaxy:1939
libNtve_gf_UnitAbilityRemoveCooldown(libNCMI_gv_nM_NovaHeroUnit, "NovaNukeTimer", "Abil/NovaNukeTimer");
UnitAbilitySpendExplicit(libNCMI_gv_nM_NovaHeroUnit, AbilityCommand("NovaNukeTimer", 0), c_spendLocationAbility, 1.0, 1.0, 1.0, 1.0);
UnitAbilityAddCooldown(libNCMI_gv_nM_NovaHeroUnit, "NovaNukeTimer", "Abil/NovaNukeTimer", (lv_lowestResearchTime - 300.0));
UnitBehaviorAdd(libNCMI_gv_nM_NovaHeroUnit, "NovaNukeTimer", libNCMI_gv_nM_NovaHeroUnit, 1);
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:5131
if (((libCOMI_gv_cM_Horner_BomberPlatforms_ReadyCount[lp_player] == 0) && (lv_smallestCooldown > 0.0) && (lv_behaviorCount > 0))) {
UnitAbilityReset(libCOMI_gv_cM_GlobalCasterUnit[lp_player], AbilityCommand("HHBomberPlatformAreaBombTopBarDummyTimer", 0), c_spendLocationAbility);
UnitAbilityAddCooldown(libCOMI_gv_cM_GlobalCasterUnit[lp_player], "HHBomberPlatformAreaBombTopBarDummyTimer", "Abil/HHBomberPlatformAreaBombTopBarDummyTimer", 60.0);
UnitAbilityAddCooldown(libCOMI_gv_cM_GlobalCasterUnit[lp_player], "HHBomberPlatformAreaBombTopBarDummyTimer", "Abil/HHBomberPlatformAreaBombTopBarDummyTimer", (-1.0 * (60.0 - lv_smallestCooldown)));
UnitBehaviorAdd(libCOMI_gv_cM_GlobalCasterUnit[lp_player], "HHBomberPlatformAreaBombTopBarDummyTimer", libCOMI_gv_cM_GlobalCasterUnit[lp_player], 1);
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:5132
UnitAbilityReset(libCOMI_gv_cM_GlobalCasterUnit[lp_player], AbilityCommand("HHBomberPlatformAreaBombTopBarDummyTimer", 0), c_spendLocationAbility);
UnitAbilityAddCooldown(libCOMI_gv_cM_GlobalCasterUnit[lp_player], "HHBomberPlatformAreaBombTopBarDummyTimer", "Abil/HHBomberPlatformAreaBombTopBarDummyTimer", 60.0);
UnitAbilityAddCooldown(libCOMI_gv_cM_GlobalCasterUnit[lp_player], "HHBomberPlatformAreaBombTopBarDummyTimer", "Abil/HHBomberPlatformAreaBombTopBarDummyTimer", (-1.0 * (60.0 - lv_smallestCooldown)));
UnitBehaviorAdd(libCOMI_gv_cM_GlobalCasterUnit[lp_player], "HHBomberPlatformAreaBombTopBarDummyTimer", libCOMI_gv_cM_GlobalCasterUnit[lp_player], 1);
UnitBehaviorSetDurationRemaining(libCOMI_gv_cM_GlobalCasterUnit[lp_player], "HHBomberPlatformAreaBombTopBarDummyTimer", lv_smallestCooldown);
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:15789
lv_multiplier = UnitWeaponSpeedMultiplier(lv_unit, 1);
UnitAbilityReset(lv_unit, AbilityCommand("RavagerAbathurCorrosiveBile", 0), c_spendLocationAll);
UnitAbilityAddCooldown(lv_unit, "RavagerAbathurCorrosiveBile", "Abil/RavagerAbathurCorrosiveBile", (lv_cooldown*lv_multiplier));
return true;
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:16765
if ((((TechTreeUpgradeCount(lv_dehakaPlayer, "MutatorIsPlayer1", c_techCountCompleteOnly) >= 1) && (UnitHasBehavior2(lv_targetUnit, "MutatorImmunetoPlayer1") == true)) || ((TechTreeUpgradeCount(lv_dehakaPlayer, "MutatorIsPlayer2", c_techCountCompleteOnly) >= 1) && (UnitHasBehavior2(lv_targetUnit, "MutatorImmunetoPlayer2") == true)))) {
UnitAbilityAddCooldown(lv_dehakaUnit, libCOMI_gv_c_DehakaConsumeAbil, libCOMI_gv_c_DehakaConsumeCooldownLink, 3.0);
}
else {
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:16770
if ((UnitFilterMatch(lv_targetUnit, lv_dehakaPlayer, libCOMI_gv_c_DehakaConsumeCooldownFilter) == true)) {
if ((lv_targetLife >= 600.0)) {
UnitAbilityAddCooldown(lv_dehakaUnit, libCOMI_gv_c_DehakaConsumeAbil, libCOMI_gv_c_DehakaConsumeCooldownLink, ((600.0 * lv_cooldownModifier) * libCOMI_gv_c_DehakaConsumeLifeCooldownFactor));
}
else {
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:16773
}
else {
UnitAbilityAddCooldown(lv_dehakaUnit, libCOMI_gv_c_DehakaConsumeAbil, libCOMI_gv_c_DehakaConsumeCooldownLink, ((lv_targetLife * lv_cooldownModifier) * libCOMI_gv_c_DehakaConsumeLifeCooldownFactor));
}
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:28275
UnitSetPropertyFixed(lv_source, c_unitPropShields, 0.0);
libNtve_gf_UnitAbilityRemoveCooldown(lv_source, "ZeratulStructureBarrier", "Abil/ZeratulStructureBarrier");
UnitAbilityAddCooldown(lv_projection, "ZeratulStructureBarrier", "Abil/ZeratulStructureBarrier", lv_cooldown);
return true;
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:28313
UnitCreateEffectUnit(lv_projection, "TimedLifeFate", lv_projection);
libNtve_gf_UnitAbilityRemoveCooldown(lv_source, "ZeratulStructureBarrier", "Abil/ZeratulStructureBarrier");
UnitAbilityAddCooldown(lv_source, "ZeratulStructureBarrier", "Abil/ZeratulStructureBarrier", lv_cooldown);
return true;
}