# Charge Used For Unit

Grammar — Charges used of charge inCharge on unit inUnit
FlagsNative | Function

Returns the number of charges used for the specified unit charge link.

# Arguments

  • unit — Unit
  • string<charge> — Charge

Returns — fixed

native fixed UnitGetChargeUsed(
	unit inUnit,
	string inCharge,
);

Category: Unit / Charges And Cooldowns

# Examples

mods/core.sc2modbase.sc2data/TriggerLibs/NativeLib.galaxy:5849

    // Automatic Variable Declarations
    // Implementation
    UnitAddChargeUsed(lp_inUnit, lp_inCharge, (-1.0 * UnitGetChargeUsed(lp_inUnit, lp_inCharge)));
}

mods/core.stormmodbase.stormdata/TriggerLibs/NativeLib.galaxy:4987

    // Automatic Variable Declarations
    // Implementation
    UnitAddChargeUsed(lp_inUnit, lp_inCharge, (-1.0 * UnitGetChargeUsed(lp_inUnit, lp_inCharge)));
}

mods/heroesdata.stormmodbase.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.stormmodbase.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.stormmodbase.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.stormmodbase.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.stormmodbase.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.stormmodbase.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.stormmodbase.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.stormmodbase.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.stormmodbase.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.stormmodbase.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;
}