# Ability Charge Info For Unit

Grammar — Charge type|Info for ability abilityCommand|Ability on unit unit
FlagsNative | Function

Returns the specified charge information for the specified ability on the specified unit.

# Arguments

Returns — fixed

native fixed UnitAbilityChargeInfo(
	unit inUnit,
	abilcmd inAbilCmd,
	int inType,
);

Category: Unit / Charges And Cooldowns

# Examples

campaigns/swarm.sc2campaignbase.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.sc2campaignbase.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.sc2mapMapScript.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.sc2mapMapScript.galaxy:391

    // Automatic Variable Declarations
    // Implementation
    return FixedToInt(UnitAbilityChargeInfo(gv_hyperion, AbilityCommand("SJHyperionFighters", 0), c_unitAbilChargeCountMax));
}

campaigns/swarmstory.sc2campaignbase.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.sc2campaignbase.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.sc2campaignbase.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.sc2campaignbase.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.stormmodbase.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.stormmodbase.stormdata/LibBBAY.galaxy:421

    }

    return FixedToInt(UnitAbilityChargeInfo(libBBAY_gv_mMBBCannonballsGhostShip, AbilityCommand("GhostShipBombardChargedPort", 0), c_unitAbilChargeCountLeft));
}

mods/starcoop/starcoop.sc2modbase.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.sc2modbase.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.sc2modbase.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.sc2modbase.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.sc2modbase.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.sc2modbase.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.sc2modbase.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.sc2modbase.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.sc2modbase.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.sc2modbase.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.sc2modbase.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.sc2modbase.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.sc2modbase.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.sc2modbase.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.sc2modbase.sc2data/LibCOMU.galaxy:10337

    }

    libCOUI_gf_SetSingularBossBarCurrentValueVoidCampaign(FixedToInt(UnitAbilityChargeInfo(libCOMU_gv_cT_CandyBowlUnit, AbilityCommand("MutatorBuyCandy", 0), c_unitAbilChargeCountLeft)), true);
    return true;
}

mods/testmods/autopve.stormmodbase.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.stormmodbase.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;