function ModifyHeroStat takes integer whichStat, unit whichHero, integer modifyMethod, integer value returns nothing
if (modifyMethod == bj_MODIFYMETHOD_ADD) then
call SetHeroStat(whichHero, whichStat, GetHeroStatBJ(whichStat, whichHero, false) + value)
elseif (modifyMethod == bj_MODIFYMETHOD_SUB) then
call SetHeroStat(whichHero, whichStat, GetHeroStatBJ(whichStat, whichHero, false) - value)
elseif (modifyMethod == bj_MODIFYMETHOD_SET) then
call SetHeroStat(whichHero, whichStat, value)
else
// Unrecognized modification method - ignore the request.
endif
endfunction