The integer loop is completely unnecessary there. You access the player directly through the "num" integer, as it represents that player slot's number, thus the "layer" of every array of this system.
Because each player slot has different number, then it is impossible for two random player slots to have saved information in one same "layer" of array (thus replacing the last data that were there).
The system will bug even more, because it will return either 1750 gold (in case the unit which bought the item already has the ability) or 1575 (9x 175, because the first time the loop runs, that unit has level of ability = 0; but the remaining 9 times the level is no longer equal to 0)
I'm not sure what DJAB wants though. It would be nice if he explained.
Either a) You have a list of 7 abilities and you can have active only 4 of those, but you can learn the remaining 3 which are not active, but at the cost that of the 3 active abilities get replaced - and you can do this repeatedly.
or b) Works same as a), but you cannot do this repeatedly - if you learn the 7th ability (the 3rd inactive ability), you can no longer access the replaced abilities.
Anyway, I assumed it's the option a), thus I will show the trigger for that:
-
Untitled Trigger 001
-

Events
-


Unit - A unit Sells an item (from shop)
-

Conditions
-


(Item-type of (Sold Item)) Equal to Meat Hook
-

Actions
-


Set unit = (Buying unit)
-


Set PlayerNum = (Player number of (Owner of unit))
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




(Level of Meat Hook for unit) Equal to 0
-



Then - Actions
-




Unit - Remove Ability[((PlayerNum x 4) + Index[PlayerNum])] from unit
-




Unit - Add Meat Hook to unit
-




Set Ability[((PlayerNum x 4) + Index[PlayerNum])] = Meat Hook
-




Set Index[PlayerNum] = (Index[PlayerNum] + 1)
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






Index[PlayerNum] Greater than 3
-





Then - Actions
-





Else - Actions
-



Else - Actions
-




Player - Add 350 to (Owner of unit) Current gold //this is the buying price of the item
-


Item - Remove (Sold Item)
Anyway, to make a whole system, it would be best to save all items and abilities to them related inside arrays for easier check.
If this is what you want, I could provide a test map with it.