# Add Charge Used For Unit Behavior

Grammar — Add inVal charges used for charge inCharge on behavior inBehavior on unit inUnit
FlagsNative | Action

Consumes the specified number of charges for the specified behavior charge link.

# Arguments

  • unit — Unit
  • string<gamelink::Behavior> — Behavior
  • string<charge> — Charge
  • fixed — Value

Returns — void

native void UnitBehaviorAddChargeUsed(
	unit inUnit,
	string inBehavior,
	string inCharge,
	fixed inVal,
);

Category: Unit / Charges And Cooldowns

# Examples

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

    // Automatic Variable Declarations
    // Implementation
    UnitBehaviorAddChargeUsed(lp_inUnit, lp_inBehavior, lp_inCharge, (-1.0 * UnitBehaviorGetChargeUsed(lp_inUnit, lp_inBehavior, lp_inCharge)));
}

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

    // Automatic Variable Declarations
    // Implementation
    UnitBehaviorAddChargeUsed(lp_inUnit, lp_inBehavior, lp_inCharge, (-1.0 * UnitBehaviorGetChargeUsed(lp_inUnit, lp_inBehavior, lp_inCharge)));
}