# Modify Cooldown For Unit
Grammar — Modifies the cooldown inCooldown on unit inUnit by using operation inCooldownOperation with parameter inVal seconds.
Flags —Native
|Action
Modifies current cooldown time for the specified unit cooldown link.
# Arguments
unit
— Unitstring
<cooldown> — Cooldownfixed
— Valueint
<preset::CooldownOperations> — Cooldown Operation
Returns — void
native void UnitModifyCooldown(
unit inUnit,
string inCooldown,
fixed inVal,
int inOperation,
);
# 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
mods/core.sc2mod — base.sc2data/TriggerLibs/NativeLib.galaxy:5867
// Automatic Variable Declarations
// Implementation
UnitModifyCooldown(lp_inUnit, lp_inCooldown, 0.0, c_cooldownOperationSet);
}
mods/core.stormmod — base.stormdata/TriggerLibs/NativeLib.galaxy:5005
// Automatic Variable Declarations
// Implementation
UnitModifyCooldown(lp_inUnit, lp_inCooldown, 0.0, c_cooldownOperationSet);
}
mods/heroes.stormmod — base.stormmaps/maps/heroes/singleplayermaps/startingexperience/tutorialveteran.stormmap/MapScript.galaxy:3558
SoundtrackPlay(PlayerGroupAll(), c_soundtrackCategoryMusic, "MX_TutorialVet_ChallengeStart1", c_soundtrackCueAny, c_soundtrackIndexAny, false);
UnitBehaviorRemove(libStEx_gv_hERO_PlayerUnit, "HeroGenericPregameAbilitySuppression", 1);
UnitModifyCooldown(gv__1A_GardenTerror, "Abil/UnderworldBossStun", 5.0, c_cooldownOperationSet);
libNtve_gf_MakeUnitUncommandable(libStEx_gv_hERO_PlayerUnit, false);
libStEx_gf_ActivateDamageforUnit(libStEx_gv_hERO_PlayerUnit);
mods/heroes.stormmod/base.stormmaps/maps/heroes/singleplayermaps/startingexperience/tutorialveteran.stormmap — MapScript.galaxy:3558
SoundtrackPlay(PlayerGroupAll(), c_soundtrackCategoryMusic, "MX_TutorialVet_ChallengeStart1", c_soundtrackCueAny, c_soundtrackIndexAny, false);
UnitBehaviorRemove(libStEx_gv_hERO_PlayerUnit, "HeroGenericPregameAbilitySuppression", 1);
UnitModifyCooldown(gv__1A_GardenTerror, "Abil/UnderworldBossStun", 5.0, c_cooldownOperationSet);
libNtve_gf_MakeUnitUncommandable(libStEx_gv_hERO_PlayerUnit, false);
libStEx_gf_ActivateDamageforUnit(libStEx_gv_hERO_PlayerUnit);
mods/heroesbrawlmods/arenamodemods/trialgrounds.stormmod — base.stormdata/LibAMVS.galaxy:865
lv_abilLink = libGame_gv_players[lv_heroIndex].lv_heroData.lv_abilities[lv_itAbility].lv_ability;
lv_cooldownLink = CatalogFieldValueGet(c_gameCatalogAbil, lv_abilLink, "Cost[" + IntToString(0) + "].Cooldown.Link", UnitGetOwner(lp_unit));
UnitModifyCooldown(lp_unit, lv_cooldownLink, lv_cDRAmount, c_cooldownOperationAdd);
if ((libGame_gv_players[lv_heroIndex].lv_heroData.lv_abilities[lv_itAbility].lv_usesCharges == true)) {
lv_chargeLink = CatalogFieldValueGet(c_gameCatalogAbil, lv_abilLink, "Cost[" + IntToString(0) + "].Charge.Link", UnitGetOwner(lp_unit));
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:605
if (((UnitIsAlive(libGDHL_gv_heroArtanisSpearofAdunPurifierBeamTarget[lp_owner]) == false) || (UnitHasBehavior2(libGDHL_gv_heroArtanisSpearofAdunPurifierBeamTarget[lp_owner], "Dead") == true) || (UnitHasBehaviorWithCategoryFlag(libGDHL_gv_heroArtanisSpearofAdunPurifierBeamTarget[lp_owner], c_behaviorCategorySpecialDeathState) == true)) && (UnitHasBehavior2(lv_artanis, "ArtanisSpearofAdunTargetPurifiedSupressionBehavior") == true)) {
UnitKill(lp_purifierBeam);
UnitModifyCooldown(lv_artanis, "Abil/ArtanisSpearofAdunPurifierBeam", 10.0, c_cooldownOperationSet);
break;
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:2706
}
UnitModifyCooldown(lv_murky, "Abil/MurkyRespawnEgg", -60.0, c_cooldownOperationAdd);
if ((PlayerHasTalent(lp_player, "MurkyEggHunt") == true)) {
Wait(0.0625, c_timeGame);
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:4964
Wait(0.0625, c_timeGame);
}
UnitModifyCooldown(lv_abathur, lv_symbioteAbilityCooldownLink, 4.0, c_cooldownOperationSet);
UnitModifyCooldown(lv_abathur, lv_toxicNestAbilityCooldownLink, 0.5, c_cooldownOperationSet);
libGame_gv_players[lv_abathurPlayer].lv_cameraForcedLock = false;
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:4965
}
UnitModifyCooldown(lv_abathur, lv_symbioteAbilityCooldownLink, 4.0, c_cooldownOperationSet);
UnitModifyCooldown(lv_abathur, lv_toxicNestAbilityCooldownLink, 0.5, c_cooldownOperationSet);
libGame_gv_players[lv_abathurPlayer].lv_cameraForcedLock = false;
libGame_gv_players[lv_abathurPlayer].lv_cameraPlayerUnitGroupToFocusOn = libGame_gv_players[lv_abathurPlayer].lv_heroUnitGroup;
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:5305
lv_cooldownLink = CatalogFieldValueGet(c_gameCatalogAbil, lv_abilLink, "Cost[" + IntToString(0) + "].Cooldown.Link", auto6824BDCC_var);
lv_cooldownValue = CatalogFieldValueGetAsInt(c_gameCatalogAbil, lv_abilLink, "Cost[" + IntToString(0) + "].Cooldown.TimeUse", auto6824BDCC_var);
UnitModifyCooldown(libGame_gv_players[auto6824BDCC_var].lv_heroUnit, lv_cooldownLink, lv_cooldownValue, c_cooldownOperationSet);
if ((libMapM_gf_MapMechanicExistsOnMap("BlackheartsBay") == true) && (UnitBehaviorCount(lv_ultimateEvolutionUnit, "MapMechanicStack") > UnitBehaviorCount(libGame_gv_players[auto6824BDCC_var].lv_heroUnit, "MapMechanicStack"))) {
UnitBehaviorAdd(libGame_gv_players[auto6824BDCC_var].lv_heroUnit, "MapMechanicStack", libGame_gv_players[auto6824BDCC_var].lv_heroUnit, (UnitBehaviorCount(lv_ultimateEvolutionUnit, "MapMechanicStack") - UnitBehaviorCount(libGame_gv_players[auto6824BDCC_var].lv_heroUnit, "MapMechanicStack")));
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:5988
UnitBehaviorAdd(libGDHL_gf_AbathurSymbioteUnit(), "AbathurMonstrosityDeepTunnelCarry", libGDHL_gf_AbathurSymbioteUnit(), 1);
lv_deepTunnelCD = UnitGetCooldown(libGDHL_gf_AbathurSymbioteTarget(), "Abil/AbathurMonstrosityDeepTunnel");
UnitModifyCooldown(libGDHL_gf_AbathurSymbioteUnit(), "Abil/AbathurMonstrosityDeepTunnelRedirect", lv_deepTunnelCD, c_cooldownOperationSet);
return true;
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:11042
if (auto05CCF55D_var == null) { break; }
if ((UnitGetType(auto05CCF55D_var) == "HeroKaelthas")) {
UnitModifyCooldown(auto05CCF55D_var, "Abil/KaelthasVerdantSpheres", 0.0, c_cooldownOperationSet);
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:17086
if ((lv_cooldownOnEgg <= libGDHL_gv_mURKY_BAL_EGG_DEATH_cd)) {
lv_cooldownToAdd = (libGDHL_gv_mURKY_BAL_EGG_DEATH_cd - lv_cooldownOnEgg);
UnitModifyCooldown(libGame_gv_players[lv_eggOwnerPlayer].lv_heroUnit, CatalogFieldValueGet(c_gameCatalogAbil, "MurkyRespawnEgg", "Cost[" + IntToString(0) + "].Cooldown.Link", UnitGetOwner(libGame_gv_players[lv_eggOwnerPlayer].lv_heroUnit)), lv_cooldownToAdd, c_cooldownOperationAdd);
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:18469
for ( ; ( (auto7A59D43D_ai >= 0 && lv_itPlayer <= auto7A59D43D_ae) || (auto7A59D43D_ai < 0 && lv_itPlayer >= auto7A59D43D_ae) ) ; lv_itPlayer += auto7A59D43D_ai ) {
if ((PlayerHasTalent(lv_itPlayer, "RaynorACardToPlay") == true)) {
UnitModifyCooldown(libGame_gv_players[lv_itPlayer].lv_heroUnit, CatalogFieldValueGet(c_gameCatalogAbil, "RaynorHyperion", "Cost[" + IntToString(0) + "].Cooldown.Link", lv_itPlayer), lv_cooldownReduction, c_cooldownOperationDefault);
UnitModifyCooldown(libGame_gv_players[lv_itPlayer].lv_heroUnit, CatalogFieldValueGet(c_gameCatalogAbil, "RaynorRaynorsBansheeTargeted", "Cost[" + IntToString(0) + "].Cooldown.Link", lv_itPlayer), lv_cooldownReduction, c_cooldownOperationDefault);
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:18470
if ((PlayerHasTalent(lv_itPlayer, "RaynorACardToPlay") == true)) {
UnitModifyCooldown(libGame_gv_players[lv_itPlayer].lv_heroUnit, CatalogFieldValueGet(c_gameCatalogAbil, "RaynorHyperion", "Cost[" + IntToString(0) + "].Cooldown.Link", lv_itPlayer), lv_cooldownReduction, c_cooldownOperationDefault);
UnitModifyCooldown(libGame_gv_players[lv_itPlayer].lv_heroUnit, CatalogFieldValueGet(c_gameCatalogAbil, "RaynorRaynorsBansheeTargeted", "Cost[" + IntToString(0) + "].Cooldown.Link", lv_itPlayer), lv_cooldownReduction, c_cooldownOperationDefault);
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameLib.galaxy:8172
lv_abilLink = libGame_gv_players[lv_heroIndex].lv_heroData.lv_abilities[lv_itAbility].lv_ability;
lv_cooldownLink = CatalogFieldValueGet(c_gameCatalogAbil, lv_abilLink, "Cost[" + IntToString(0) + "].Cooldown.Link", lv_playerID);
UnitModifyCooldown(lp_targetUnit, lv_cooldownLink, lp_cooldownChange, c_cooldownOperationAdd);
if ((libGame_gv_players[lv_heroIndex].lv_heroData.lv_abilities[lv_itAbility].lv_usesCharges == true)) {
lv_chargeLink = CatalogFieldValueGet(c_gameCatalogAbil, lv_abilLink, "Cost[" + IntToString(0) + "].Charge.Link", lv_playerID);
mods/heroesmapmods/battlegroundmapmods/warheadjunction.stormmod — base.stormdata/LibMSC2.galaxy:587
lv_enemyTeam = libGame_gf_EnemyTeam(lv_allyTeam);
UnitBehaviorAdd(lv_varUnit, "HasMapMechanicTargetAbility", lv_varUnit, 1);
UnitModifyCooldown(lv_varUnit, "Abil/MapMechanicNuke", libMSC2_gv_mMSC2NukeArmingDuration_C, c_cooldownOperationMax);
UnitModifyCooldown(lv_varUnit, "Abil/MapMechanicAbilityTarget", libMSC2_gv_mMSC2NukeArmingDuration_C, c_cooldownOperationMax);
libMSC2_gf_MMSC2ShowHideNukeTextTagsForPlayer(false, lv_player);
mods/heroesmapmods/battlegroundmapmods/warheadjunction.stormmod — base.stormdata/LibMSC2.galaxy:588
UnitBehaviorAdd(lv_varUnit, "HasMapMechanicTargetAbility", lv_varUnit, 1);
UnitModifyCooldown(lv_varUnit, "Abil/MapMechanicNuke", libMSC2_gv_mMSC2NukeArmingDuration_C, c_cooldownOperationMax);
UnitModifyCooldown(lv_varUnit, "Abil/MapMechanicAbilityTarget", libMSC2_gv_mMSC2NukeArmingDuration_C, c_cooldownOperationMax);
libMSC2_gf_MMSC2ShowHideNukeTextTagsForPlayer(false, lv_player);
libMSC2_gf_MMSC2NukeButtonStartFlashingForPlayer(lv_player);
mods/heroesmapmods/battlegroundmapmods/warheadjunction.stormmod — base.stormdata/LibMSC2.galaxy:1979
}
UnitModifyCooldown(EventPlayerEffectUsedUnit(c_effectUnitCaster), "Abil/MapMechanicNuke", libMSC2_gv_mMSC2NukeInterruptDelay_C, c_cooldownOperationSet);
UnitModifyCooldown(EventPlayerEffectUsedUnit(c_effectUnitCaster), "Abil/MapMechanicAbilityTarget", libMSC2_gv_mMSC2NukeInterruptDelay_C, c_cooldownOperationSet);
return true;
mods/heroesmapmods/battlegroundmapmods/warheadjunction.stormmod — base.stormdata/LibMSC2.galaxy:1980
UnitModifyCooldown(EventPlayerEffectUsedUnit(c_effectUnitCaster), "Abil/MapMechanicNuke", libMSC2_gv_mMSC2NukeInterruptDelay_C, c_cooldownOperationSet);
UnitModifyCooldown(EventPlayerEffectUsedUnit(c_effectUnitCaster), "Abil/MapMechanicAbilityTarget", libMSC2_gv_mMSC2NukeInterruptDelay_C, c_cooldownOperationSet);
return true;
}
mods/heromods/samuro.stormmod — base.stormdata/LibHSAM.galaxy:1063
lv_abilLink = libGame_gv_players[lv_samuroPlayer].lv_heroData.lv_abilities[lv_itAbility].lv_ability;
lv_cooldownLink = CatalogFieldValueGet(c_gameCatalogAbil, lv_abilLink, "Cost[" + IntToString(0) + "].Cooldown.Link", lv_samuroPlayer);
UnitModifyCooldown(lv_mirrorImage, lv_cooldownLink, UnitGetCooldown(lv_samuro, lv_cooldownLink), c_cooldownOperationSet);
}
if ((EventUnitCreatedAbil() == "SamuroWindwalk")) {
mods/heromods/thefirelords.stormmod — base.stormdata/LibHMaj.galaxy:294
libHMaj_gv_ragnarosUnit2[lv_ragnarosPlayer] = null;
UnitSelect(lv_regularRagnarosUnit, lv_ragnarosPlayer, true);
UnitModifyCooldown(lv_regularRagnarosUnit, "Abil/RagnarosMoltenCore", CatalogFieldValueGetAsInt(c_gameCatalogAbil, "RagnarosMoltenCore", "Cost.Cooldown.TimeUse", lv_ragnarosPlayer), c_cooldownOperationSet);
libGame_gv_players[lv_ragnarosPlayer].lv_cameraPlayerUnitGroupToFocusOn = libNtve_gf_ConvertUnitToUnitGroup(lv_regularRagnarosUnit);
libGame_gv_players[lv_ragnarosPlayer].lv_activeVehicle = null;
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:15748
lv_multiplier = UnitWeaponSpeedMultiplier(EventPlayerEffectUsedUnit(c_effectUnitCaster), 1);
UnitAbilityReset(EventPlayerEffectUsedUnit(c_effectUnitCaster), AbilityCommand("LocustLaunch", 0), c_spendLocationUnit);
UnitModifyCooldown(EventPlayerEffectUsedUnit(c_effectUnitCaster), "Abil/LocustLaunch", ((lv_cooldown * lv_multiplier) / 16.0), c_cooldownOperationSet);
UnitBehaviorSetDurationRemaining(EventPlayerEffectUsedUnit(c_effectUnitCaster), "SwarmHostEggAnimation", ((lv_cooldown * lv_multiplier) / 16.0));
return true;
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:24493
libCOMI_gv_cM_Stukov_InfestedStructure[lv_player] = EventUnit();
UnitModifyCooldown(libCOMI_gv_cM_Stukov_InfestedStructure[lv_player], "Abil/SICivilianStructureSpawnCivilian", 180.0, c_cooldownOperationSet);
UnitBehaviorAdd(EventUnit(), "SICivilianStructureSpawnCivilianGlobalTimerInitial", EventUnit(), 1);
TriggerEnable(TriggerGetCurrent(), false);
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:25092
}
UnitModifyCooldown(lv_unit, "ShieldCooldown", lv_cooldown, c_cooldownOperationSet);
UnitModifyCooldown(lv_unit, "ShieldCooldown", lv_cooldown, c_cooldownOperationSet);
return true;
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:25093
UnitModifyCooldown(lv_unit, "ShieldCooldown", lv_cooldown, c_cooldownOperationSet);
UnitModifyCooldown(lv_unit, "ShieldCooldown", lv_cooldown, c_cooldownOperationSet);
return true;
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMU.galaxy:14056
}
else if (true) {
UnitModifyCooldown(lv_boombothelper, "Abil/MutatorBoomBotDefuse", libCOMI_gf_DifficultyValueFixed2(libCOMI_gf_DifficultyLevelForPlayerCoop(EventPlayer()), 1.0, 3.0, 5.0, 8.0, 8.0, 8.0), c_cooldownOperationDefault);
if ((lv_speedstacks > 0)) {
auto1F0E61FB_g = UnitGroup(null, c_playerAny, RegionCircle(UnitGetPosition(lv_boombothelper), 0.1), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
mods/warcoop/progression/equipments.sc2mod — base.sc2data/LibPEqu.galaxy:67
}
UnitModifyCooldown(lv_attacker, "Artifact/ArtifactHeroAttackTeleport", 10.0, c_cooldownOperationSet);
UnitSetPosition(lv_attacker, UnitTypePlacementFromPoint(UnitGetType(lv_attacker), lv_attackingowner, UnitGetPosition(lv_defender), 10.0), false);
ActorCreate(ActorScopeFromUnit(lv_attacker), "RemoveUnitTeleportVisual", null, null, null);