Here is a very inefficient but simple method:
Create a script called "ActionHandler.sqs"
Private ["_unit"]
_unit = _this select 0
@(_unit == leader _unit)
_unit addaction ["ALL - HOLD FIRE","Combatmode.sqs"]
EXIT
then in init line of all units able to become the leader:
[this] exec "ActionHandler.sqs"
I say this is inefficient because all units will be checking if they are the leader every 3 secs.
Better method is to use "Killed" eventhandler, but requires managing of groups and units ahead of time.
Anyway, the above will work if you are desperate