# Add Charge Used For Unit
Grammar — Add inVal charges used for charge inCharge on unit inUnit
Flags —Native
|Action
Consumes the specified number of charges for the specified unit charge link.
# Arguments
unit
— Unitstring
<charge> — Chargefixed
— Value
Returns — void
native void UnitAddChargeUsed(
unit inUnit,
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
campaigns/liberty.sc2campaign — base.sc2maps/maps/campaign/thorner05s.sc2map/MapScript.galaxy:1456
SoundPlay(SoundLink("TUISecret", 0), PlayerGroupAll(), 100.0, 0.0);
if ((libNtve_gf_DifficultyValueInt(1, 1, 0, 0) == 1)) {
UnitAddChargeUsed(gv_raynor, "RaynorTossGrenade", -3.0);
}
else {
campaigns/liberty.sc2campaign — base.sc2maps/maps/campaign/thorner05s.sc2map/MapScript.galaxy:1459
}
else {
UnitAddChargeUsed(gv_raynor, "RaynorTossGrenade", -2.0);
}
Wait(1.0, c_timeGame);
campaigns/liberty.sc2campaign — base.sc2maps/maps/campaign/thorner05s.sc2map/MapScript.galaxy:1532
SoundPlay(SoundLink("TUISecret", 0), PlayerGroupAll(), 100.0, 0.0);
if ((libNtve_gf_DifficultyValueInt(1, 1, 0, 0) == 1)) {
UnitAddChargeUsed(gv_raynor, "RaynorPlasmaGun", -3.0);
}
else {
campaigns/liberty.sc2campaign — base.sc2maps/maps/campaign/thorner05s.sc2map/MapScript.galaxy:1535
}
else {
UnitAddChargeUsed(gv_raynor, "RaynorPlasmaGun", -2.0);
}
Wait(1.0, c_timeGame);
campaigns/liberty.sc2campaign — base.sc2maps/maps/campaign/thorner05s.sc2map/MapScript.galaxy:1608
SoundPlay(SoundLink("TUISecret", 0), PlayerGroupAll(), 100.0, 0.0);
if ((libNtve_gf_DifficultyValueInt(1, 1, 0, 0) == 1)) {
UnitAddChargeUsed(gv_raynor, "RaynorTimeBomb", -1.0);
}
else {
campaigns/liberty.sc2campaign — base.sc2maps/maps/campaign/thorner05s.sc2map/MapScript.galaxy:1611
}
else {
UnitAddChargeUsed(gv_raynor, "RaynorTimeBomb", -1.0);
}
Wait(1.0, c_timeGame);
campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/thorner05s.sc2map — MapScript.galaxy:1456
SoundPlay(SoundLink("TUISecret", 0), PlayerGroupAll(), 100.0, 0.0);
if ((libNtve_gf_DifficultyValueInt(1, 1, 0, 0) == 1)) {
UnitAddChargeUsed(gv_raynor, "RaynorTossGrenade", -3.0);
}
else {
campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/thorner05s.sc2map — MapScript.galaxy:1459
}
else {
UnitAddChargeUsed(gv_raynor, "RaynorTossGrenade", -2.0);
}
Wait(1.0, c_timeGame);
campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/thorner05s.sc2map — MapScript.galaxy:1532
SoundPlay(SoundLink("TUISecret", 0), PlayerGroupAll(), 100.0, 0.0);
if ((libNtve_gf_DifficultyValueInt(1, 1, 0, 0) == 1)) {
UnitAddChargeUsed(gv_raynor, "RaynorPlasmaGun", -3.0);
}
else {
campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/thorner05s.sc2map — MapScript.galaxy:1535
}
else {
UnitAddChargeUsed(gv_raynor, "RaynorPlasmaGun", -2.0);
}
Wait(1.0, c_timeGame);
campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/thorner05s.sc2map — MapScript.galaxy:1608
SoundPlay(SoundLink("TUISecret", 0), PlayerGroupAll(), 100.0, 0.0);
if ((libNtve_gf_DifficultyValueInt(1, 1, 0, 0) == 1)) {
UnitAddChargeUsed(gv_raynor, "RaynorTimeBomb", -1.0);
}
else {
campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/thorner05s.sc2map — MapScript.galaxy:1611
}
else {
UnitAddChargeUsed(gv_raynor, "RaynorTimeBomb", -1.0);
}
Wait(1.0, c_timeGame);
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zspace01.sc2map/MapScript.galaxy:819
auto76730D7A_n = (gf_HyperionFighterCountMax() - gf_HyperionFighterCountCurrent());
for (auto76730D7A_i = 1; auto76730D7A_i <= auto76730D7A_n; auto76730D7A_i += 1) {
UnitAddChargeUsed(gv_hyperion, "SJHyperionFighters", -1.0);
}
}
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zspace01.sc2map/MapScript.galaxy:3161
gv_hyperionFighterRecalling = false;
if ((gf_HyperionFighterCountCurrent() < gf_HyperionFighterCountMax())) {
UnitAddChargeUsed(gv_hyperion, "SJHyperionFighters", -1.0);
}
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zspace01.sc2map/MapScript.galaxy:3413
}
UnitAddChargeUsed(gv_hyperion, "SJHyperionFighters", -1.0);
TriggerStop(gt_LaunchHyperionFighters);
gf_RecallHyperionFighters();
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zspace01.sc2map/MapScript.galaxy:3566
gv_tacFightersLost += 1;
UnitAddChargeUsed(gv_hyperion, "SJHyperionFighters", 1.0);
if ((UnitGroupCount(gv_hyperionFighterGroup, c_unitCountAlive) == 0)) {
gf_RecallHyperionFighters();
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zspace01.sc2map — MapScript.galaxy:819
auto76730D7A_n = (gf_HyperionFighterCountMax() - gf_HyperionFighterCountCurrent());
for (auto76730D7A_i = 1; auto76730D7A_i <= auto76730D7A_n; auto76730D7A_i += 1) {
UnitAddChargeUsed(gv_hyperion, "SJHyperionFighters", -1.0);
}
}
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zspace01.sc2map — MapScript.galaxy:3161
gv_hyperionFighterRecalling = false;
if ((gf_HyperionFighterCountCurrent() < gf_HyperionFighterCountMax())) {
UnitAddChargeUsed(gv_hyperion, "SJHyperionFighters", -1.0);
}
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zspace01.sc2map — MapScript.galaxy:3413
}
UnitAddChargeUsed(gv_hyperion, "SJHyperionFighters", -1.0);
TriggerStop(gt_LaunchHyperionFighters);
gf_RecallHyperionFighters();
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zspace01.sc2map — MapScript.galaxy:3566
gv_tacFightersLost += 1;
UnitAddChargeUsed(gv_hyperion, "SJHyperionFighters", 1.0);
if ((UnitGroupCount(gv_hyperionFighterGroup, c_unitCountAlive) == 0)) {
gf_RecallHyperionFighters();
mods/core.sc2mod — base.sc2data/TriggerLibs/NativeLib.galaxy:5849
// Automatic Variable Declarations
// Implementation
UnitAddChargeUsed(lp_inUnit, lp_inCharge, (-1.0 * UnitGetChargeUsed(lp_inUnit, lp_inCharge)));
}
mods/core.stormmod — base.stormdata/TriggerLibs/NativeLib.galaxy:4987
// Automatic Variable Declarations
// Implementation
UnitAddChargeUsed(lp_inUnit, lp_inCharge, (-1.0 * UnitGetChargeUsed(lp_inUnit, lp_inCharge)));
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:7990
}
UnitAddChargeUsed(lv_butcher, lv_freshMeatChargeLink, (lv_changeInCharges * -1));
return true;
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:10016
}
UnitAddChargeUsed(lv_caster, "Abil/FaerieDragonPixieCharm", -1.0);
return true;
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:10311
}
UnitAddChargeUsed(lv_unit, "Abil/IllidanBladesOfAzzinoth", -1.0);
return true;
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:12611
if ((PlayerHasTalent(EventPlayer(), "LeoricMasteryOsseinRenewal") == true)) {
UnitCreateEffectUnit(lv_leoric, "LeoricOsseinRenewalGlobeImpactSet", lv_leoric);
UnitAddChargeUsed(lv_leoric, "Abil/LeoricOsseinRenewal", -1.0);
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:17389
}
UnitAddChargeUsed(lv_caster, "Abil/MurkyAFishyDeal", -1.0);
return true;
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:17821
UnitCreateEffectUnit(lv_nova, "TalentBribeAdd1Token", lv_nova);
if ((ModI(UnitBehaviorCount(lv_nova, libGame_gv_players[lv_player].lv_bribeTokenLink), libGame_gv_players[lv_player].lv_bribeChargeStackRequirement) == 0)) {
UnitAddChargeUsed(lv_nova, "Abil/TalentBucketBribe", -1.0);
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:21581
}
UnitAddChargeUsed(lv_unit, "Abil/SgtHammerSiegeModeDestructiveMunitions", -1.0);
return true;
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:22511
}
UnitAddChargeUsed(lv_caster, "Abil/SylvanasPossession", 2.0);
UnitAddChargeRegenRemaining(lv_caster, "Abil/SylvanasPossession", 0.0);
return true;
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:22887
}
UnitAddChargeUsed(lv_caster, "Abil/ThrallAncestralWrath", -1.0);
return true;
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:24981
lv_chargeLink = CatalogFieldValueGet(c_gameCatalogAbil, lv_abilLink, "Cost[" + IntToString(0) + "].Charge.Link", UnitGetOwner(lv_hero));
UnitAddChargeUsed(lv_hero, lv_chargeLink, -1.0);
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameLib.galaxy:8114
lv_chargeLink = CatalogFieldValueGet(c_gameCatalogAbil, lv_abilLink, "Cost[" + IntToString(0) + "].Charge.Link", UnitGetOwner(lv_itUnit));
lv_chargeCount = CatalogFieldValueGetAsInt(c_gameCatalogAbil, lv_abilLink, "Cost[" + IntToString(0) + "].Charge.CountMax", UnitGetOwner(lv_itUnit));
UnitAddChargeUsed(lv_itUnit, lv_chargeLink, (-lv_chargeCount));
PlayerAddChargeUsed(lp_player, lv_chargeLink, (-lv_chargeCount));
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameLib.galaxy:9254
UnitCreateEffectUnit(lv_bribeOwnerUnit, "TalentBribeAdd1Token", lv_bribeOwnerUnit);
if ((ModI(UnitBehaviorCount(lv_bribeOwnerUnit, libGame_gv_players[lp_killingPlayer].lv_bribeTokenLink), libGame_gv_players[lp_killingPlayer].lv_bribeChargeStackRequirement) == 0)) {
UnitAddChargeUsed(lv_bribeOwnerUnit, "Abil/TalentBucketBribe", -1.0);
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/SupportLib.galaxy:1654
libNtve_gf_PlayerRemoveCooldown(lv_ownerofUnit, lv_cooldownLink);
lv_chargeLink = CatalogFieldValueGet(c_gameCatalogAbil, lv_abilLink, "Cost[" + IntToString(0) + "].Charge.Link", lv_ownerofUnit);
UnitAddChargeUsed(lp_unit, lv_chargeLink, -1.0);
PlayerAddChargeUsed(lv_ownerofUnit, lv_cooldownLink, -1.0);
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/SupportLib.galaxy:1760
if ((lv_tokenBehavior == "ButcherFreshMeatTokenCounter")) {
lv_chargeLink = CatalogFieldValueGet(c_gameCatalogAbil, "ButcherFreshMeatDummy", "Cost[" + IntToString(0) + "].Charge.Link", lp_player);
UnitAddChargeUsed(lv_itSelectedUnit, lv_chargeLink, (-(lv_newTokenCount - lv_currentTokenCount)));
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/SupportLib.galaxy:1765
if ((lv_tokenBehavior == "WitchDoctorVoodooRitualTokenCounter")) {
lv_chargeLink = CatalogFieldValueGet(c_gameCatalogAbil, "WitchDoctorVoodooRitualDummy", "Cost[" + IntToString(0) + "].Charge.Link", lp_player);
UnitAddChargeUsed(lv_itSelectedUnit, lv_chargeLink, (-(lv_newTokenCount - lv_currentTokenCount)));
}
mods/heromods/hanzo.stormmod — base.stormdata/LibHHAN.galaxy:723
}
UnitAddChargeUsed(lv_hanzoUnit, "Abil/HanzoNaturalAgilityButton", -1.0);
return true;
}
mods/warcoop/warclassicsystem.sc2mod — base.sc2data/TriggerLibs/WarClassicSystem.galaxy:1732
libNtve_gf_UnitRemoveChargeUsed(lv_u, libGAwX_gv_hearthstoneChargeLink);
UnitAddChargeUsed(lv_u, libGAwX_gv_hearthstoneChargeLink, (libGAwX_gv_hearthstoneChargeMax - lv_c));
return true;
}