# Charge Used For Unit
Grammar — Charges used of charge inCharge on unit inUnit
Flags —Native
|Function
Returns the number of charges used for the specified unit charge link.
# Arguments
unit
— Unitstring
<charge> — Charge
Returns — fixed
native fixed UnitGetChargeUsed(
unit inUnit,
string inCharge,
);
# 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: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:7982
lv_butcher = libGame_gv_players[lv_butcherPlayer].lv_heroUnit;
lv_maxCharges = FixedToInt(CatalogReferenceGetAsInt("Abil,ButcherFreshMeatDummy,Cost.Charge.CountMax", c_playerAny));
lv_currentCharges = (lv_maxCharges - FixedToInt(UnitGetChargeUsed(lv_butcher, lv_freshMeatChargeLink)));
lv_changeInCharges = (UnitBehaviorCount(lv_butcher, "ButcherFreshMeatTokenCounter") - lv_currentCharges);
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/HeroesLib.galaxy:2868
else {
lv_chargeLink = CatalogFieldValueGet(c_gameCatalogAbil, lp_ability, "Cost[" + IntToString(0) + "].Charge.Link", c_playerAny);
lv_chargeUsed = UnitGetChargeUsed(lp_unit, lv_chargeLink);
if ((lv_chargeUsed > 0.0)) {
lv_time = UnitGetChargeRegen(lp_unit, lv_chargeLink);
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/UILib.galaxy:6702
lv_playerUnit = libUIUI_gv_uIPartyFrame.lv_heroUnits[lv_playerRosterSlot][libUIUI_gv_uIPartyFrameHeroSlot_C];
if ((libUIUI_gf_UIPartyFrameSpecialCaseHeroHasHeroicCoolup(UnitGetType(lv_playerUnit)) == true)) {
lv_heroicCoolupCharges = UnitGetChargeUsed(lv_playerUnit, CatalogFieldValueGet(c_gameCatalogAbil, lv_heroicAbilityLink, "Cost.Charge.Link", lv_playerIndex));
lv_heroicCoolupChargesMax = IntToFixed(CatalogFieldValueGetAsInt(c_gameCatalogAbil, lv_heroicAbilityLink, "Cost.Charge.CountMax", lv_playerIndex));
lv_heroicCoolupCharges = (lv_heroicCoolupChargesMax - lv_heroicCoolupCharges);
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/UILib.galaxy:6852
if ((lv_chargesMax > 0)) {
lv_chargeLink = CatalogFieldValueGet(c_gameCatalogAbil, lp_ability, "Cost.Charge.Link", lp_player);
lv_chargesUsed = UnitGetChargeUsed(lp_unit, lv_chargeLink);
if ((lv_chargesUsed >= IntToFixed(lv_chargesMax))) {
lv_cooldownTime = UnitGetChargeRegen(lp_unit, lv_chargeLink);
mods/heromods/dehaka.stormmod — base.stormdata/LibHDEH.galaxy:554
lv_dehakaPlayer = UnitGetOwner(lv_dehakaUnit);
lv_healAmount = (((libHDEH_gv_heroDehakaEssenceCollectionMaxStackCount[lv_dehakaPlayer] - UnitGetChargeUsed(lv_dehakaUnit, "Abil/DehakaEssenceCollection")) * CatalogFieldValueGetAsFixed(c_gameCatalogEffect, "DehakaEssenceCollectionCreateHealer", "RechargeVitalRate", lv_dehakaPlayer)) / CatalogFieldValueGetAsFixed(c_gameCatalogBehavior, "DehakaEssenceCollectionHealBehavior", "PeriodCount", lv_dehakaPlayer));
libGame_gf_ScoreValuesReportRealValueAndLog(lv_dehakaPlayer, "DehakaEssenceCollectionHealing", 0.0);
CatalogFieldValueSetFixed(c_gameCatalogEffect, "DehakaEssenceCollectionCatalogCreateHealer", "RechargeVitalRate", lv_dehakaPlayer, lv_healAmount);
mods/heromods/dehaka.stormmod — base.stormdata/LibHDEH.galaxy:620
libHDEH_gf_HeroDehakaTalentEnhancedAgilityAddEssenceForPlayer(lv_player, lv_stacksToAdd);
libHDEH_gf_HeroDehakaTalentTissueRegenerationAddEssenceForPlayer(lv_player, lv_stacksToAdd);
libGame_gf_ScoreValuesReportRealValueAndLog(lv_player, "DehakaEssenceCollectionHealing", ((libHDEH_gv_heroDehakaEssenceCollectionMaxStackCount[lv_player] - UnitGetChargeUsed(lv_dehakaUnit, "Abil/DehakaEssenceCollection")) * CatalogFieldValueGetAsFixed(c_gameCatalogEffect, "DehakaEssenceCollectionCreateHealer", "RechargeVitalRate", lv_player)));
return true;
}
mods/heromods/dehaka.stormmod — base.stormdata/LibHDEH.galaxy:688
libHDEH_gf_HeroDehakaTalentEnhancedAgilityAddEssenceForPlayer(lv_player, lv_stacksToAdd);
libHDEH_gf_HeroDehakaTalentTissueRegenerationAddEssenceForPlayer(lv_player, lv_stacksToAdd);
libGame_gf_ScoreValuesReportRealValueAndLog(lv_player, "DehakaEssenceCollectionHealing", ((libHDEH_gv_heroDehakaEssenceCollectionMaxStackCount[lv_player] - UnitGetChargeUsed(lv_dehakaUnit, "Abil/DehakaEssenceCollection")) * CatalogFieldValueGetAsFixed(c_gameCatalogEffect, "DehakaEssenceCollectionCreateHealer", "RechargeVitalRate", lv_player)));
return true;
}
mods/heromods/dehaka.stormmod — base.stormdata/LibHDEH.galaxy:736
libHDEH_gf_HeroDehakaTalentEnhancedAgilityAddEssenceForPlayer(lv_player, lv_stacksToAdd);
libHDEH_gf_HeroDehakaTalentTissueRegenerationAddEssenceForPlayer(lv_player, lv_stacksToAdd);
libGame_gf_ScoreValuesReportRealValueAndLog(lv_player, "DehakaEssenceCollectionHealing", ((libHDEH_gv_heroDehakaEssenceCollectionMaxStackCount[lv_player] - UnitGetChargeUsed(lv_caster, "Abil/DehakaEssenceCollection")) * CatalogFieldValueGetAsFixed(c_gameCatalogEffect, "DehakaEssenceCollectionCreateHealer", "RechargeVitalRate", lv_player)));
return true;
}
mods/heromods/dehaka.stormmod — base.stormdata/LibHDEH.galaxy:1096
}
libGame_gf_ScoreValuesReportRealValueAndLog(lv_player, "DehakaEssenceCollectionHealing", ((libHDEH_gv_heroDehakaEssenceCollectionMaxStackCount[lv_player] - UnitGetChargeUsed(lv_dehakaUnit, "Abil/DehakaEssenceCollection")) * CatalogFieldValueGetAsFixed(c_gameCatalogEffect, "DehakaEssenceCollectionCreateHealer", "RechargeVitalRate", lv_player)));
return true;
}
mods/heromods/dehaka.stormmod — base.stormdata/LibHDEH.galaxy:1142
libHDEH_gf_HeroDehakaTalentEnhancedAgilityAddEssenceForPlayer(lv_player, lv_essenceCollectedAmount);
libHDEH_gf_HeroDehakaTalentTissueRegenerationAddEssenceForPlayer(lv_player, lv_essenceCollectedAmount);
libGame_gf_ScoreValuesReportRealValueAndLog(lv_player, "DehakaEssenceCollectionHealing", ((libHDEH_gv_heroDehakaEssenceCollectionMaxStackCount[lv_player] - UnitGetChargeUsed(lv_derhaka, "Abil/DehakaEssenceCollection")) * CatalogFieldValueGetAsFixed(c_gameCatalogEffect, "DehakaEssenceCollectionCreateHealer", "RechargeVitalRate", lv_player)));
return true;
}