# Add Charge Used For Unit Ability
Grammar — Add inVal charges used for charge inCharge on ability inAbil on unit inUnit
Flags —Native
|Action
Consumes the specified number of charges for the specified ability charge link.
# Arguments
unit
— Unitstring
<gamelink::Abil> — Abilitystring
<charge> — Chargefixed
— Value
Returns — void
native void UnitAbilityAddChargeUsed(
unit inUnit,
string inAbil,
string inCharge,
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
mods/core.sc2mod — base.sc2data/TriggerLibs/NativeLib.galaxy:5843
// Automatic Variable Declarations
// Implementation
UnitAbilityAddChargeUsed(lp_inUnit, lp_inAbil, lp_inCharge, (-1.0 * UnitAbilityGetChargeUsed(lp_inUnit, lp_inAbil, lp_inCharge)));
}
mods/core.stormmod — base.stormdata/TriggerLibs/NativeLib.galaxy:4981
// Automatic Variable Declarations
// Implementation
UnitAbilityAddChargeUsed(lp_inUnit, lp_inAbil, lp_inCharge, (-1.0 * UnitAbilityGetChargeUsed(lp_inUnit, lp_inAbil, lp_inCharge)));
}
mods/heroesbrawlmods/brawlmapmods/coop/deadmansstand.stormmod — base.stormdata/LibPEB1.galaxy:2476
VisRevealArea(libCore_gv_cOMPUTER_TeamChaos, RegionCircle(libPEB1_gv_currentScourgeMissileTargetPoint, 4.0), 4.0, false);
VisRevealArea(libCore_gv_cOMPUTER_TeamOrder, RegionCircle(UnitGetPosition(libPEB1_gv_currentScourgeMissileCaster), 6.0), 4.0, false);
UnitAbilityAddChargeUsed(libPEB1_gv_currentScourgeMissileCaster, "GhostShipBombardChargedPort", "Abil/BattleshipBombardCharged", 1.0);
if ((libPEB1_gv_scourgeMissileTargetPing == c_invalidPingId)) {
libCore_gf_CreateMinimapPingStorm(PlayerGroupAll(), "StormGhostShipImpact", UnitGetPosition(libPEB1_gv_currentScourgeMissileTargetUnit), ColorWithAlpha(100.00, 0.00, 0.00, 0.00), 3.0);
mods/heroesmapmods/battlegroundmapmods/blackheartsbay.stormmod — base.stormdata/LibBBAY.galaxy:283
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));
UnitAbilityAddChargeUsed(libBBAY_gv_mMBBCannonballsGhostShip, "GhostShipBombardChargedStarboard", "Abil/BattleshipBombardCharged", (lv_currentCharges - lv_targetCharges));
libBBAY_gv_mMBBCannonballsGhostShipTotalAmmo = lv_targetCharges;
mods/heroesmapmods/battlegroundmapmods/blackheartsbay.stormmod — base.stormdata/LibBBAY.galaxy:284
lv_targetCharges = (libBBAY_gv_mMBBCannonballsStartInBattleship_C + libBBAY_gv_mMBBCannonballsStockedInBattleship_C);
UnitAbilityAddChargeUsed(libBBAY_gv_mMBBCannonballsGhostShip, "GhostShipBombardChargedPort", "Abil/BattleshipBombardCharged", (lv_currentCharges - lv_targetCharges));
UnitAbilityAddChargeUsed(libBBAY_gv_mMBBCannonballsGhostShip, "GhostShipBombardChargedStarboard", "Abil/BattleshipBombardCharged", (lv_currentCharges - lv_targetCharges));
libBBAY_gv_mMBBCannonballsGhostShipTotalAmmo = lv_targetCharges;
lv_itCannonTarget = 1;
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:14354
lv_actualCreator = UnitLastCreated();
if ((UnitOrderIsValid(lv_actualCreator, lv_order1) == false) && (UnitOrderIsValid(lv_actualCreator, lv_order2) == false)) {
UnitAbilityAddChargeUsed(lv_warpGate, libCOMI_gv_warpGateTrainAbility, "WarpGateTrain", -1.0);
UnitRemove(lv_actualCreator);
return true;
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:14457
if ((UnitBehaviorCount(lv_creator, libCOMI_gv_supplicantWarpTrainWarpRefundBehaviorLink) > 0)) {
lv_warpGate = UnitBehaviorEffectUnit(lv_creator, libCOMI_gv_supplicantWarpTrainCreatorWarpGateFinderBehaviorLink, c_effectUnitCaster, 0);
UnitAbilityAddChargeUsed(lv_warpGate, libCOMI_gv_warpGateTrainAbility, "WarpGateTrain", -1.0);
UnitRemove(lv_creator);
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMU.galaxy:3412
}
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);
libNtve_gf_PlayAnimation(libNtve_gf_MainActorofUnit(lp_civilianUnit), c_animNameDefault, "Stand Victory", 0, c_animTimeDefault);
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMU.galaxy:7623
TriggerEnable(libCOMU_gt_CT_CandyBowlTextUpdate, true);
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)) {