U need to define the units before creating.
When creating, a trigger has to detect the unit created (defined)
and then adding the special ability.
Create a spellbook, add your ability in it and then create a trigger which disables the spellbook.
In this way it might work.