# Activate Ability Cooldowns

Grammar — Activate spendLocation|Location cooldowns on ability abilityCommand|Ability on unit u
FlagsNative | Action

Activates the specified cooldowns on the specified ability on the specified unit. In most cases, this will cause the ability to act as if it had just been used.

# Arguments

  • unit — Unit
  • abilcmd — Ability Command
  • int<preset::Unit_Color_Change_Option24> — Spend Location
  • fixed — Vitals Factor
  • fixed — Resources Factor
  • fixed — Charges Factor
  • fixed — Cooldown Factor

Returns — void

native void UnitAbilitySpendExplicit(
	unit inUnit,
	abilcmd inAbilCmd,
	int inLocation,
	fixed inVitalsFactor,
	fixed inResourcesFactor,
	fixed inChargesFactor,
	fixed inCooldownFactor,
);

Category: Unit / Charges And Cooldowns

# Examples

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameDataHelperLib.galaxy:20926


    UnitAbilityReset(lv_sgtHammerUnit, AbilityCommand("SgtHammerSiegeMode", 0), c_spendLocationAll);
    UnitAbilitySpendExplicit(lv_sgtHammerUnit, AbilityCommand("SgtHammerSiegeMode", 0), c_spendLocationAll, 0.0, 1.0, 1.0, 1.0);
    return true;
}

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameLib.galaxy:18039

    }
    if ((lv_dummyEffect != null)) {
        UnitAbilitySpendExplicit(lv_heroUnit, lv_cmd, c_spendLocationAll, 1.0, 1.0, 1.0, 1.0);
        UnitCreateEffectPoint(lv_heroUnit, lv_dummyEffect, lv_point);
    }

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/MapMechanicsLib.galaxy:7438

    }

    UnitAbilitySpendExplicit(libMapM_gv_mMGardensDragonStatue, AbilityCommand("LeaveVehicle", 0), c_spendLocationAbility, 1.0, 1.0, 1.0, 1.0);
    return true;
}

mods/missionpacks/novacampaign.sc2modbase.sc2data/LibNCMI.galaxy:1938

        if ((lv_trainingNukeFound == true)) {
            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:28838

    }

    UnitAbilitySpendExplicit(lv_caster, lv_cmd, c_spendLocationAll, 1.0, 1.0, 1.0, 1.0);
    return true;
}

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:28875

    }

    UnitAbilitySpendExplicit(lv_caster, lv_cmd, c_spendLocationAll, 1.0, 1.0, 1.0, 1.0);
    return true;
}

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:28912

    }

    UnitAbilitySpendExplicit(lv_caster, lv_cmd, c_spendLocationAll, 1.0, 1.0, 1.0, 1.0);
    return true;
}