oh btw i found an interesting solution: remember your idea about the heros being "beat up" instead of being just killed in the first place? well it seems "phoenix morphin (egg related)" is the perfect ability for this.
when the heros hp reaches 0 it will replace the unit type to what ever unit i choose (e.g. beaten troll) and give it timed life. after that it wil turn back to the initial unit.
now i wasnt sure about this, since phoenix and it's egg are just regular units (non-heroes). but it appears that it does not lose items, levels, abilities or any other valuable data about the original unit!!
also when i click the hero icon (F1) then it selects the alternate unit for me (beaten up). of course it wont lose the hero icon either (with morphing into non hero)
please tell me if you get errors or wait a bit so I can get home and make a proper system with the ability to test it :d
the system automaticly creates a hashtable links between 2 elements, the builder and the structure. with the call getLinkedUnit() you can get the other unit, for example, if you call getLinkedUnit(builder_unit) you get the structure unit, and other way around.