# Set Unit Attribute Point

Grammar — Set attribute baseBonus attribute point to count on unit unit
FlagsNative | Action

Sets attribute point on a unit.

# Arguments

  • unit — Unit
  • string [ gamelink::Behavior ] — Attribute
  • bool [ preset::BaseBonusOptions ] — Base/Bonus
  • int — Count

Returns — void

native void UnitSetAttributePoint(
	unit inUnit,
	string attribute,
	bool baseBonus,
	int count,
);

Category: Behavior / Attribute

# Examples

# mods/starcoop/starcoop.sc2mod

LibCOMI.galaxy

// L17663
UnitSetAttributePoint(lv_collectorUnit, libCOMI_gv_cM_Dehaka_EssenceAttribute, true, RoundI(UnitGetCustomValue(lv_collectorUnit, libCOMI_gv_cM_DehakaEssenceIndex)))

# mods/warcoop/warclassicsystem.sc2mod

WarClassicSystem.galaxy

// L505
UnitSetAttributePoint(lv_target, lv_itBuff, true, lv_itStack)
// L981
UnitSetAttributePoint(lv_u, "SubgroupIncrease", true, libGAwX_gv_heroCreationCount)
// L1656
UnitSetAttributePoint(lv_u, libGAwX_gv_manaFlareManaTokenLink, true, (FixedToInt(lv_mana) + UnitGetAttributePoint(lv_u, libGAwX_gv_manaFlareManaTokenLink, true)))