Well, as I said: There is no way to detect this except maybe with this event, which checks each mouse click:
Code:
EVENT_GLOBAL_MOUSE_DOWN (number eventCode, MouseButtonIndex button, boolean ctrl, boolean alt, boolean shift, boolean command)
Search on ESOUI Source Code EVENT_GLOBAL_MOUSE_UP (number eventCode, MouseButtonIndex button, boolean ctrl, boolean alt, boolean shift, boolean command)
You could check in global on mouse down if you are in combat via the API functions IsUnitInCombat("player").
But this will not tell you if you just did a light attack or heavy attack or if you have clicked somewhere on the UI just because you like to activate skills via mouse during combat. It tracks ALL clicks...