it's set up so that when you learn the ability, it takes away the old "level" of the spell and gives the new one. actually, the "hero ability" button might be a spell book-based ability. set up an array of 4 whatever for each player, have each position represent a different abil (offensive, defensive, extra, ult) and then have the trigger for buying the ability change the number at the array based on what's bought. have other triggers, one for each player, go off that when the spells are "learned" (in the spell book case, casted) it gives the next level of the spell, which is being kept track of by the array. there's somebody here who could explain it a lot better than i can, but they may not care to answer.