Here's another solution that works illustrated:
First you'll need to create an ability based on "Unholy Aura (Neutral Hostile)" ability, and tweak it to your liking, so it has regen. Remove the icon, buff and "Art - Target", remove the additional speed it provides, set targets allowed to only Self and regen to anything you want, if you want it to look like normal life regen without a spell. You can also change anything else you want for that spell and remove the icon from the "Unholy Aura" buff also, so it doesn't show a small icon in the interface in-game when the aura is active. After that, add that spell to the spells of your regenerating boss.
Next, suppose this is your boss (Phoenix), your region where units shouldn't be for him to regen (the big one), and the small region to where corpses are relocated from the big region (I will explain the need for this one later):
You need these triggers:
This one removes the regen when a unit enters the region:
-
Untitled Trigger 002
-
Events
-
Unit - A unit enters Region 000 <gen>
-
Conditions
-
((Owner of (Entering unit)) controller) Equal to User
-
Actions
-
Unit - Remove Unholy Aura (Neutral Hostile) from Phoenix 0000 <gen>
This one adds the regen when there are no units in the region after a unit has left it:
-
Untitled Trigger 001
-
Events
-
Unit - A unit leaves Region 000 <gen>
-
Conditions
-
((Owner of (Triggering unit)) controller) Equal to User
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in (Units in Region 000 <gen> owned by Player 1 (Red))) Equal to 0
-
(Number of units in (Units in Region 000 <gen> owned by Player 2 (Blue))) Equal to 0
-
Then - Actions
-
Unit - Add Unholy Aura (Neutral Hostile) to Phoenix 0000 <gen>
-
Else - Actions
This trigger adds the regen to the boss when there are no units in the region after a unit has died in it:
-
Untitled Trigger 001 Copy
-
Events
-
Unit - A unit Dies
-
Conditions
-
((Owner of (Triggering unit)) controller) Equal to User
-
(Region 000 <gen> contains (Position of (Dying unit))) Equal to True
-
Actions
-
Set point = (Center of Region 001 <gen>)
-
Unit - Move (Dying unit) instantly to point, facing Default building facing degrees
-
Custom script: call RemoveLocation(udg_point)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in (Units in Region 000 <gen> owned by Player 1 (Red))) Equal to 0
-
(Number of units in (Units in Region 000 <gen> owned by Player 2 (Blue))) Equal to 0
-
Then - Actions
-
Unit - Add Unholy Aura (Neutral Hostile) to Phoenix 0000 <gen>
-
Else - Actions
The only drawback of this system is that corpses of the units dying in the boss regen area have to be relocated to another region in this previous trigger for it to work properly.
I'm putting the test map in the attachment so you can test and copy all this from it.