Diag commands that return the last event handler id of a certain type can be useful.
One instance is the case where you want to make sure that your event handler is the last event handler. For example, in the case of a "HandleDamage" EH only the last event handler works.
unit addEventHandler ["HandleDamage", { params ["_unit"]; if (diag_eventHandlerCount [_unit, "HandleDamage"] > _thisEventHandler) { _unit removeEventHandler ["HandleDamage", _thisEventHandler]; // readd } 0 }]
sample syntax:
diag_eventHandlerCount [_unit, "HandleDamage"]