I don't think you will find a boss fight template, which really fits your needs. They are just too map dependent. However I can give you an insight what I once coded for a RPG map.
I diveded all Bosses into 4 classes.
1. SimpleBoss
Those were just better standart mobs. They were triggered with UnitInRangeEvent and the periodic timer stopped once they were dead.
All of them had 3 abilities with the same orderId based on meele or range. --> 1 and 2 meele and 3 range action.
Iirc I passed in the following arguments:
lowrange, highrange, ragetime, scaling(after ragetime), additionalAbility( most times a passive) .
I.e Taurus: targets within low range would be enganged with a strong hit or a knockback, those in highrange got charged. No targets would make him take a walk.
2. Horde (I really loved this one):
It was quite similar to SimpleBoss, but with an additional group behaviour and a group leader.
3. AdvancedBoss: (One scope per unit type.)
I used this one for units with head money, they were spawned based on quests.
It was a module, in contrast to the two above this module didn't perform unit actions, but instead gathered a huge amount of information around the boss: Closest target, injured targets, hp, realtive hp, last charged target, distance, previous distance (to the last target), meele or range, ...
Some of those parameters were evaluated and resulted in a recommended unit state --> attack, run, search, chase, ...
All ended in a static method onExpire which could be configurated individually for each UnitTypeId. Compare it to DDS where you have fields like damage, source, target, tagetId, origional damage ...
The timer was started with thistype.create() and stopped with this.destroy().
4. Individual script for a specified unit.
Final bosses should always have their very own script
.