You're in the right direction. The way that maw mount counter works is that it loops through all of your mounts and saves each spell ID when it loads, then listens for UNIT_SPELLCAST_SENT and compares the spell ID in that event with the list of known spell IDs. I'll give you the bare basics.
Make a new icon weakaura, go to Actions tab, click Custom at the top (OnInit), and put this in the box:
Lua Code:
aura_env.mountSpells = {}
for i, mountID in pairs(C_MountJournal.GetMountIDs()) do
-- 1304 is Mawsworn Soulhunter and 1442 is Corridor Creeper
-- they work in the Maw, so ignore them
if mountID ~= 1304 and mountID ~= 1442 then
local _, spellID = C_MountJournal.GetMountInfoByID(mountID)
aura_env.mountSpells[spellID] = true
end
end
Then select Custom > Event in the Trigger tab and put this in the box:
Lua Code:
function(_, unit, _, _, spellID)
return unit == "player" and aura_env.mountSpells[spellID]
end
The event you'll be putting in the small box above that is UNIT_SPELLCAST_SENT and you should see a timed box right below the custom trigger function where you can play with the time it spends shown.
Finally, in the Load tab, scroll down to Zone ID and use
1543 which is the Maw.