# Add Cooldown For Unit Ability

Grammar — Add inVal seconds to cooldown inCooldown on ability inAbil on unit inUnit
FlagsNative | Action

Adds time to the specified ability cooldown link.

# Arguments

  • unit — Unit
  • string<gamelink::Abil> — Ability
  • string<cooldown> — Cooldown
  • fixed — Value

Returns — void

native void UnitAbilityAddCooldown(
	unit inUnit,
	string inAbil,
	string inCooldown,
	fixed inVal,
);

Category: Unit / Charges And Cooldowns

# Examples

campaigns/liberty.sc2campaignbase.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.sc2mapMapScript.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.sc2modbase.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.stormmodbase.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.stormmodbase.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.stormmodbase.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.sc2modbase.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.sc2modbase.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.sc2modbase.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.sc2modbase.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.sc2modbase.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.sc2modbase.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.sc2modbase.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.sc2modbase.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.sc2modbase.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;
}