It's close but I ran into 1 problem.
attridstring is an invalid identifier, I think variables are capped at 8 characters for their names.... I renamed them to attidstr and that goes away.
It's now telling me that eachpick doesn't exist.
I set the priority to 5000 index 1 After: Calc attrBonus
Code:
var bonus as number
var attidstr as string
~ Use Int as default - this might not be necessary
bonus = #attrbonus[attrInt]
attidstr = "attrInt"
~ Find highest bonus
foreach pick in hero from Attribute
if (eachpick.field[attrBonus].value > bonus) then
bonus = eachpick.field[attrBonus].value
attidstr = eachpick.field[name].idstring
endif
nexteach
~ Use that as the damage and attack attributes
perform assignstr["DamageAttr." & attidstr]
perform assignstr["Attack." & attidstr]