Nope, I've meant that I would give you a "res_prioritylist" variable array and you'd have fill it with unit types - like this:
res_prioritylist[1] = Peasant
res_prioritylist[2] = Footman
res_prioritylist[3] = Priest
res_prioritylist[4] = Knight
etc
Then the trigger would go from the highest array number to the lowest, checking if there is an eligible unit of its type to be resurrected.
So, in the example above the trigger would first check array number 4, i.e. Knight unit type. If there was a Knight eligible for resurrection, it would pick the first one it had on the list and bring it back to life, if not it would proceed to array number 3 and thus check for Priests, etc.
This means that you'd have to assign every UNIT TYPE that the player can own (i.e. that can potentially be resurrected) to said variable, not each individual unit.
I've probably worded that in a bad way earlier, sorry
---
The original idea I had for this ability is to make a regular aura.
When a unit died with this aura's buff, a trigger would instantly create the same unit of the same type at the same location for a neutral player, instantly hide it and add it to a unit group. Then another trigger would periodically check all units inside that unit group, looking for a unit of an appropriate type in range to be resurrected. If it would a unit, it would change its owner to the player, remove it from the unit group and unhide it.
This however would likely create quite a lot of neutral units on the map, so you'd probably need an internal timer that would remove neutral units that weren't resurrected for a longer period of time to reduce the amount of units the trigger has to check. Since you don't want this, the number of hidden units would eventually get pretty high, so I resorted to doing things differently.
Right now I'm thinking about storing the position, unit type and unit facing of any unit that dies with the buff in a hashtable with a certain index, then another trigger would periodically search the hashtable for units eligible for resurrection and if it found one, it would clear the child keys of that's unit index and create a unit of that type at the stored point of its death for the player who has the aura.
I got it to properly save the unit data in the hashtable so far, right now I just need to figure out a way to write a proper "search engine" for it

And that's a bit tricky for me, so I don't really know whether I will be able to do this.
---
And no, it wouldn't reset its cooldown.
The way I want to do this is have the search engine run once the first time a unit with the required buff dies, then have the actual search trigger on a loop, i.e. once it finishes searching, it will run itself again - if it resurrected a unit in the last cycle, it will simply wait a set duration (cooldown) before doing so, thus effectively giving the ability a cooldown, if not it would run itself again without delay, so there would also be no cooldown involved, bar the time the trigger would require to complete its full cycyle.
Still, it's quite a lot of operations the game would have to do constantly, especially once the number of units that died and thus had to be checked would grow pretty high, so I'm also not really sure whether this is the best way to do this.
Thus, I hope that once
@KILLCIDE is online, he will at least share his opinion on my idea as I think he is generally more experienced and knowledgeable about making spells than I am
