# Ability Charge Info For Unit
Grammar — Charge type|Info for ability abilityCommand|Ability on unit unit
Flags —Native
|Function
Returns the specified charge information for the specified ability on the specified unit.
# Arguments
unit
— Unitabilcmd
— Ability Commandint
<preset::AbilityChargeType> — Type
Returns — fixed
native fixed UnitAbilityChargeInfo(
unit inUnit,
abilcmd inAbilCmd,
int inType,
);
# 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/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zspace01.sc2map/MapScript.galaxy:385
// Automatic Variable Declarations
// Implementation
return FixedToInt(UnitAbilityChargeInfo(gv_hyperion, AbilityCommand("SJHyperionFighters", 0), c_unitAbilChargeCountLeft));
}
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zspace01.sc2map/MapScript.galaxy:391
// Automatic Variable Declarations
// Implementation
return FixedToInt(UnitAbilityChargeInfo(gv_hyperion, AbilityCommand("SJHyperionFighters", 0), c_unitAbilChargeCountMax));
}
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zspace01.sc2map — MapScript.galaxy:385
// Automatic Variable Declarations
// Implementation
return FixedToInt(UnitAbilityChargeInfo(gv_hyperion, AbilityCommand("SJHyperionFighters", 0), c_unitAbilChargeCountLeft));
}
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zspace01.sc2map — MapScript.galaxy:391
// Automatic Variable Declarations
// Implementation
return FixedToInt(UnitAbilityChargeInfo(gv_hyperion, AbilityCommand("SJHyperionFighters", 0), c_unitAbilChargeCountMax));
}
campaigns/swarmstory.sc2campaign — base.sc2data/TriggerLibs/SwarmCampaignLib.galaxy:17337
if ((libSwaC_gv_zS_PrimaryHatchery != null) && (TechTreeUpgradeCount(1, "K5ZerglingRespawn", c_techCountCompleteOnly) == 1)) {
if ((UnitAbilityChargeInfo(libSwaC_gv_zS_PrimaryHatchery, AbilityCommand("ZerglingRespawnTrain", 0), c_unitAbilChargeCountLeft) > 0.0)) {
libNtve_gf_SendActorMessageToUnit(libSwaC_gv_zS_PrimaryHatchery, "Signal ZerglingRespawn1On");
}
campaigns/swarmstory.sc2campaign — base.sc2data/TriggerLibs/SwarmCampaignLib.galaxy:17343
libNtve_gf_SendActorMessageToUnit(libSwaC_gv_zS_PrimaryHatchery, "Signal ZerglingRespawn1Off");
}
if ((UnitAbilityChargeInfo(libSwaC_gv_zS_PrimaryHatchery, AbilityCommand("ZerglingRespawnTrain", 0), c_unitAbilChargeCountLeft) > 2.0)) {
libNtve_gf_SendActorMessageToUnit(libSwaC_gv_zS_PrimaryHatchery, "Signal ZerglingRespawn2On");
}
campaigns/swarmstory.sc2campaign — base.sc2data/TriggerLibs/SwarmCampaignLib.galaxy:17349
libNtve_gf_SendActorMessageToUnit(libSwaC_gv_zS_PrimaryHatchery, "Signal ZerglingRespawn2Off");
}
if ((UnitAbilityChargeInfo(libSwaC_gv_zS_PrimaryHatchery, AbilityCommand("ZerglingRespawnTrain", 0), c_unitAbilChargeCountLeft) > 4.0)) {
libNtve_gf_SendActorMessageToUnit(libSwaC_gv_zS_PrimaryHatchery, "Signal ZerglingRespawn3On");
}
campaigns/swarmstory.sc2campaign — base.sc2data/TriggerLibs/SwarmCampaignLib.galaxy:17355
libNtve_gf_SendActorMessageToUnit(libSwaC_gv_zS_PrimaryHatchery, "Signal ZerglingRespawn3Off");
}
if ((UnitAbilityChargeInfo(libSwaC_gv_zS_PrimaryHatchery, AbilityCommand("ZerglingRespawnTrain", 0), c_unitAbilChargeCountLeft) > 7.0)) {
libNtve_gf_SendActorMessageToUnit(libSwaC_gv_zS_PrimaryHatchery, "Signal ZerglingRespawn4On");
}
mods/heroesmapmods/battlegroundmapmods/blackheartsbay.stormmod — base.stormdata/LibBBAY.galaxy:281
lv_shipTeam = libGame_gf_TeamNumberOfPlayer(UnitGetOwner(libBBAY_gv_mMBBCannonballsGhostShip));
lv_enemyTeam = libGame_gf_EnemyTeam(lv_shipTeam);
lv_currentCharges = FixedToInt(UnitAbilityChargeInfo(libBBAY_gv_mMBBCannonballsGhostShip, AbilityCommand("GhostShipBombardChargedPort", 0), c_unitAbilChargeCountLeft));
lv_targetCharges = (libBBAY_gv_mMBBCannonballsStartInBattleship_C + libBBAY_gv_mMBBCannonballsStockedInBattleship_C);
UnitAbilityAddChargeUsed(libBBAY_gv_mMBBCannonballsGhostShip, "GhostShipBombardChargedPort", "Abil/BattleshipBombardCharged", (lv_currentCharges - lv_targetCharges));
mods/heroesmapmods/battlegroundmapmods/blackheartsbay.stormmod — base.stormdata/LibBBAY.galaxy:421
}
return FixedToInt(UnitAbilityChargeInfo(libBBAY_gv_mMBBCannonballsGhostShip, AbilityCommand("GhostShipBombardChargedPort", 0), c_unitAbilChargeCountLeft));
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:9840
// Implementation
while (true) {
while (!(((UnitAbilityGetCooldown(lp_unit, lp_ability, lp_cooldownLink) > 20.0) || ((UnitAbilityChargeInfo(lp_unit, AbilityCommand(lp_ability, 0), c_unitAbilChargeCountLeft) == 0.0) && (UnitAbilityGetChargeRegen(lp_unit, lp_ability, lp_cooldownLink) > 20.0))))) {
Wait(1.0, c_timeGame);
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:9843
Wait(1.0, c_timeGame);
}
while (!((UnitAbilityGetCooldown(lp_unit, lp_ability, lp_cooldownLink) <= 0.0) && ((UnitAbilityGetChargeRegen(lp_unit, lp_ability, lp_cooldownLink) <= 0.0) || (UnitAbilityChargeInfo(lp_unit, AbilityCommand(lp_ability, 0), c_unitAbilChargeCountLeft) > 0.0)))) {
Wait(1.0, c_timeGame);
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:9937
while (true) {
Wait(5.0, c_timeGame);
if ((UnitAbilityChargeInfo(libCOMI_gv_cM_GlobalCasterUnit[lv_locAbathurPlayer], AbilityCommand("SpawnToxicNest", 0), c_unitAbilChargeCountLeft) < lv_c_StandardCapAmount)) {
lv_belowStandardCap = true;
continue;
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:9941
continue;
}
else if ((lv_belowStandardCap == true) && (UnitAbilityChargeInfo(libCOMI_gv_cM_GlobalCasterUnit[lv_locAbathurPlayer], AbilityCommand("SpawnToxicNest", 0), c_unitAbilChargeCountLeft) >= lv_c_StandardCapAmount)) {
Wait(10.0, c_timeGame);
if ((UnitAbilityChargeInfo(libCOMI_gv_cM_GlobalCasterUnit[lv_locAbathurPlayer], AbilityCommand("SpawnToxicNest", 0), c_unitAbilChargeCountLeft) >= lv_c_StandardCapAmount)) {
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:9943
else if ((lv_belowStandardCap == true) && (UnitAbilityChargeInfo(libCOMI_gv_cM_GlobalCasterUnit[lv_locAbathurPlayer], AbilityCommand("SpawnToxicNest", 0), c_unitAbilChargeCountLeft) >= lv_c_StandardCapAmount)) {
Wait(10.0, c_timeGame);
if ((UnitAbilityChargeInfo(libCOMI_gv_cM_GlobalCasterUnit[lv_locAbathurPlayer], AbilityCommand("SpawnToxicNest", 0), c_unitAbilChargeCountLeft) >= lv_c_StandardCapAmount)) {
lv_belowStandardCap = false;
libCOMI_gf_CM_CommanderVOSend(lv_locAbathurPlayer, SoundLink("AbathurCommander_ToxicNest", -1), PlayerGroupSingle(lv_locAbathurPlayer));
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:9950
}
else if ((UnitAbilityChargeInfo(libCOMI_gv_cM_GlobalCasterUnit[lv_locAbathurPlayer], AbilityCommand("SpawnToxicNest", 0), c_unitAbilChargeCountMax) <= (lv_c_StandardCapAmount+2.0))) {
continue;
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:9953
continue;
}
else if ((UnitAbilityChargeInfo(libCOMI_gv_cM_GlobalCasterUnit[lv_locAbathurPlayer], AbilityCommand("SpawnToxicNest", 0), c_unitAbilChargeCountLeft) < UnitAbilityChargeInfo(libCOMI_gv_cM_GlobalCasterUnit[lv_locAbathurPlayer], AbilityCommand("SpawnToxicNest", 0), c_unitAbilChargeCountMax))) {
lv_belowFinalCap = true;
continue;
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:9953
continue;
}
else if ((UnitAbilityChargeInfo(libCOMI_gv_cM_GlobalCasterUnit[lv_locAbathurPlayer], AbilityCommand("SpawnToxicNest", 0), c_unitAbilChargeCountLeft) < UnitAbilityChargeInfo(libCOMI_gv_cM_GlobalCasterUnit[lv_locAbathurPlayer], AbilityCommand("SpawnToxicNest", 0), c_unitAbilChargeCountMax))) {
lv_belowFinalCap = true;
continue;
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:9957
continue;
}
else if ((lv_belowFinalCap == true) && (UnitAbilityChargeInfo(libCOMI_gv_cM_GlobalCasterUnit[lv_locAbathurPlayer], AbilityCommand("SpawnToxicNest", 0), c_unitAbilChargeCountLeft) >= UnitAbilityChargeInfo(libCOMI_gv_cM_GlobalCasterUnit[lv_locAbathurPlayer], AbilityCommand("SpawnToxicNest", 0), c_unitAbilChargeCountMax))) {
Wait(10.0, c_timeGame);
if ((UnitAbilityChargeInfo(libCOMI_gv_cM_GlobalCasterUnit[lv_locAbathurPlayer], AbilityCommand("SpawnToxicNest", 0), c_unitAbilChargeCountLeft) >= UnitAbilityChargeInfo(libCOMI_gv_cM_GlobalCasterUnit[lv_locAbathurPlayer], AbilityCommand("SpawnToxicNest", 0), c_unitAbilChargeCountMax))) {
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:9957
continue;
}
else if ((lv_belowFinalCap == true) && (UnitAbilityChargeInfo(libCOMI_gv_cM_GlobalCasterUnit[lv_locAbathurPlayer], AbilityCommand("SpawnToxicNest", 0), c_unitAbilChargeCountLeft) >= UnitAbilityChargeInfo(libCOMI_gv_cM_GlobalCasterUnit[lv_locAbathurPlayer], AbilityCommand("SpawnToxicNest", 0), c_unitAbilChargeCountMax))) {
Wait(10.0, c_timeGame);
if ((UnitAbilityChargeInfo(libCOMI_gv_cM_GlobalCasterUnit[lv_locAbathurPlayer], AbilityCommand("SpawnToxicNest", 0), c_unitAbilChargeCountLeft) >= UnitAbilityChargeInfo(libCOMI_gv_cM_GlobalCasterUnit[lv_locAbathurPlayer], AbilityCommand("SpawnToxicNest", 0), c_unitAbilChargeCountMax))) {
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMU.galaxy:3411
auto3045BD6C_at = auto3045BD6C_at + 1.0;
}
if ((libNtve_gf_UnitInRegion(lp_civilianUnit, RegionCircle(UnitGetPosition(libCOMU_gv_cT_CandyBowlUnit), 3.0)) == true) && (UnitAbilityChargeInfo(libCOMU_gv_cT_CandyBowlUnit, AbilityCommand("MutatorBuyCandy", 0), c_unitAbilChargeCountLeft) >= 1)) {
UnitAbilityAddChargeUsed(libCOMU_gv_cT_CandyBowlUnit, "MutatorBuyCandy", "Abil/MutatorBuyCandy", 1.0);
UnitIssueOrder(lp_civilianUnit, Order(AbilityCommand("stop", 0)), c_orderQueueReplace);
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMU.galaxy:3416
libNtve_gf_PlayAnimation(libNtve_gf_MainActorofUnit(lp_civilianUnit), c_animNameDefault, "Stand Victory", 0, c_animTimeDefault);
TextTagSetText(libCOMU_gv_cT_CandyBowlTextTag, TextExpressionAssemble("Param/Expression/lib_COMU_03AF339A"));
libCOUI_gf_SetSingularBossBarCurrentValueVoidCampaign(FixedToInt(UnitAbilityChargeInfo(libCOMU_gv_cT_CandyBowlUnit, AbilityCommand("MutatorBuyCandy", 0), c_unitAbilChargeCountLeft)), true);
Wait(3.0, c_timeGame);
UnitRemove(lp_civilianUnit);
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMU.galaxy:7624
libCOUI_gf_DisplaySingularBossBarVoidCampaign("Assets\\Textures\\btn-tips-scrap.dds", StringExternal("Param/Value/lib_COMU_066CB91C"), 50);
UnitAbilityAddChargeUsed(libCOMU_gv_cT_CandyBowlUnit, "MutatorBuyCandy", "Abil/MutatorBuyCandy", lv_initialCandy);
libCOUI_gf_SetSingularBossBarCurrentValueVoidCampaign(FixedToInt(UnitAbilityChargeInfo(libCOMU_gv_cT_CandyBowlUnit, AbilityCommand("MutatorBuyCandy", 0), c_unitAbilChargeCountLeft)), true);
if ((libCOMU_gf_MutatorIsEnabled("TrickOrTreat") == true)) {
TriggerEnable(libCOMU_gt_CT_TrickOrTreatSpawn, true);
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMU.galaxy:7630
Wait(1.0, c_timeGame);
libCOUI_gf_SetSingularBossBarCurrentValueVoidCampaign(FixedToInt(UnitAbilityChargeInfo(libCOMU_gv_cT_CandyBowlUnit, AbilityCommand("MutatorBuyCandy", 0), c_unitAbilChargeCountLeft)), true);
Wait(0.0625, c_timeGame);
autoA5A3C408_g = libCOOC_gf_HumanPlayers();
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMU.galaxy:10337
}
libCOUI_gf_SetSingularBossBarCurrentValueVoidCampaign(FixedToInt(UnitAbilityChargeInfo(libCOMU_gv_cT_CandyBowlUnit, AbilityCommand("MutatorBuyCandy", 0), c_unitAbilChargeCountLeft)), true);
return true;
}
mods/testmods/autopve.stormmod — base.stormdata/Lib1035AFB3.galaxy:397
return true;
}
else if ((UnitAbilityChargeInfo(lib1035AFB3_gv_azmodan, AbilityCommand("AzmodanSummonDemonWarrior", 0), c_unitAbilChargeCountLeft) >= 1)) {
UnitIssueOrder(lib1035AFB3_gv_azmodan, OrderTargetingPoint(AbilityCommand("AzmodanSummonDemonWarrior", 0), UnitGetGoalPosition(lib1035AFB3_gv_azmodan)), c_orderQueueReplace);
return true;
mods/testmods/autopve.stormmod — base.stormdata/Lib1035AFB3.galaxy:487
return true;
}
else if ((UnitAbilityChargeInfo(lib1035AFB3_gv_nazeebo, AbilityCommand("WitchDoctorPlagueofToads", 0), c_unitAbilChargeCountLeft) >= 1)) {
UnitIssueOrder(lib1035AFB3_gv_nazeebo, OrderTargetingPoint(AbilityCommand("WitchDoctorPlagueofToads", 0), UnitGetGoalPosition(lib1035AFB3_gv_nazeebo)), c_orderQueueReplace);
return true;