How do I give a unit a self-replenishing property like the general units or the unique units in M2TW:Kingdoms?

I'm trying to add them to a unique unit with a unit cap of 1, but is not a general's bodyguard unit.