Event:
unit has died (generic)
Conditions:
Actions:
set dyingUnitType = unit-type of triggering unit
set realVariable1 = convert triggering unit's real value (hit points) (uHoc or smt I believe)
set realVariable2 = convert triggering unit's real value (mana)
etc..
*(remove triggering unit from game) optional, or disable can decay in object editor
create 1 dyingUnitType for triggering player at X and Y position of triggering unit
set lastcreatedunit's hit points to realVariable1
set lastcreatedunit's mana to realVariable2
etc..