This is how I do it. You will need three triggers.
1) A trigger that detects when a unit enters a "tripwire" region that starts the boss fight, or similar. You could also make this trigger run when a hero enters the boss fight area like I've done below:
Trigger:
Boss Fail Detection Start
Events
Unit - A unit enters Boss fight area <gen>
Conditions
((Triggering unit) belongs to an enemy of <Owner of the boss unit> Equal to True
Actions
Trigger - Turn off (This trigger)
Countdown Timer - Start BossFailTimer as a Repeating timer that will expire in 2.00 seconds
^This trigger as you can see simply starts a repeating countdown timer when a unit enters the boss fight area. We will refer to this timer in the second trigger.
2) A second trigger that checks if there still are any heroes left in the boss fight area
Trigger:
Boss Fail
Events
Time - BossFailTimer expires
Conditions
Actions
Set TempUnitGroup1 = (Units in Boss fight area <gen> matching (((Matching unit) belongs to an enemy of <Owner of the boss unit> Equal to True))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in TempUnitGroup1) Equal to 0
Then - Actions
Countdown Timer - Pause BossFailTimer
Trigger - Turn on Boss Fail Detection Start <gen>
----Do all the other stuff you want to do when you reset the fight----
^This trigger periodically puts all units in the boss fight area that are enemies to the boss (i e player units) into a unit group variable and checks if there are any units in the group. If there aren't, it means all units fighting the boss have died (or fled ) and that the fight should be reset.
3) A third trigger that pauses the timer when the boss is killed so we accidentally don't reset the fight again when the victorious heroes leave the area:
Trigger:
Boss Win
Events
Unit - A unit Dies
Conditions
(Triggering unit) Equal to YourBossVariable (or you could do a "unit-type of triggering unit equal to <Boss unit>" here)
Actions
Trigger - Turn off (This trigger)
Countdown Timer - Pause BossFailTimer
---Do other stuff that happens when the boss dies here---
I'm on a page about incorrect corrections, and spent the better part of like two hours trying to get someone to understand that -5^2 = -25, not 25, and then that post had comments get reposted because that group is self sustaining, and that person was in turn trying to explain what I just explained to them. And I'm taking that as a victory
I will be AFK for a couple of days you guys hold down the fort while I am gone. I will be checking in on my phone but that will severly limit me. Be back saturday!