Did you try to look at a unit like Alchemist to see its ability Chemical rage? This is an example. You can look in the Neutral units and find three alchemists.Theese are the ones the original alchemist morphs to. Look in the object editor, at the ability editor. Find chemical rage and see what units are mentioned there. Replace them with your own unit, and replace Hero Ability - true with false. When you hero has 35% hit points or lower, add this ability to your hero, and cast it immediatly.
Melee Initialization
Events
Unit - A unit Is attacked
Conditions
(Unit-type of (Triggering unit)) Equal to Footman
(Life of (Triggering unit)) Less than or equal to ((Max life of (Triggering unit)) x 0.35)
Actions
Unit - Remove (Triggering unit) from the game
Unit - Create 1 Footman for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing (Center of (Playable map area))
Wait until ((Life of (Last created unit)) Greater than or equal to ((Max life of (Last created unit)) x 0.35)), checking every 1.00 seconds
Unit - Remove (Last created unit) from the game
Unit - Create 1 Footman for (Owner of (Last created unit)) at (Position of (Last created unit)) facing (Center of (Playable map area))
Maybe something like this?
Code:Melee Initialization Events Unit - A unit Is attacked Conditions (Unit-type of (Triggering unit)) Equal to Footman (Life of (Triggering unit)) Less than or equal to ((Max life of (Triggering unit)) x 0.35) Actions Unit - Remove (Triggering unit) from the game Unit - Create 1 Footman for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing (Center of (Playable map area)) Wait until ((Life of (Last created unit)) Greater than or equal to ((Max life of (Last created unit)) x 0.35)), checking every 1.00 seconds Unit - Remove (Last created unit) from the game Unit - Create 1 Footman for (Owner of (Last created unit)) at (Position of (Last created unit)) facing (Center of (Playable map area))
Where you replace the first footman with the metamorhpsied unit and the 2nd footman with the original unit.
You can also make another trigger to stop this one from checking if the unit dies?
Edit: Found a few mistakes in trigger
Melee Initialization
Events
Unit - A unit Is attacked
Conditions
(Unit-type of (Triggering unit)) Equal to Footman
(Life of (Triggering unit)) Less than or equal to ((Max life of (Triggering unit)) x 0.35)
Actions
Unit - Add Robo Goblin to (Triggering unit)
Unit - Order (Triggering unit) to Neutral Tinker - Activate Robo Goblin
Wait 1.00 seconds
Unit - Remove Robo Goblin from (Triggering unit)
Wait until ((Life of (Triggering unit)) Greater than or equal to ((Max life of (Last created unit)) x 0.35)), checking every 1.00 seconds
Unit - Add Robo Goblin to (Triggering unit)
Unit - Order (Triggering unit) to Neutral Tinker - Deactivate Robo Goblin
Wait 1.00 seconds
Unit - Remove Robo Goblin From (Triggering unit)
Also when you go nito ability editor you can make it so that the icon doesn't show up so nobody has to see a random icon appear and be pressed