From the code at ZOs actionbuttons you can use this small function to check a slotNum (index of the slot, see my first post with the slot indices) if it contains an abilityId:
Lua Code:
local function HasAbility(slotnum)
local slotType = GetSlotType(slotnum)
return slotType == ACTION_TYPE_ABILITY
end
And if this returns true the slot's actionButton should provide an abilityId in it's variable .button.actionId.
See here:
https://github.com/esoui/esoui/blob/...utton.lua#L274
And this was determined via this function:
So you should be able to get the abilityId this way.
I hope it IS the abilityId