Originally Posted by
evn
Assuming you've got your table of abilities + cooldowns + exceptions (ie: set bonus reducing the cooldown of an ability) you just need a way to link it with times that those abilities were used. Head over to the weak auras forums and browse the 'tracking absorbs tutorial' and 'tracking current stats' threads. Those work slightly different (they capture values on the player) butt he basic process is the same:
Make a table with unitguids. For each guid make a table that has spell ids. Make a trigger on combat_log_event_unfiltered. When an ability you're interested in has been cast you'll update your tables with the time that it was cast wa_ability_tracker[unitguid][spellid] = time_right_now. You'll maybe want to do do some calculation for expiring time(s), prioritization, counting cooldowns, etc.
You'll want some additional code to clear out your tables when units die or have nothing interesting happen for some period of time. The 'tracking current stats' thread example code has a pretty good way to handle that. After that you're going to want a handful of icons/progress bars etc. in a group. Each one will have custom code for name, icon, progress, durration, etc. Those auras will display information in the table -- you'll want them to watch for events like target_changed etc. and update accordingly. An example that works fairly well is the absorb tracker thread: it has solid examples for name/icon/progress functions and how you can use them to drive a display.
The tracking part isn't too hard but the display portion can get out of hand fairly quickly. It's easy to just display one or two abilities (like pvp trinkets or battle res) but when you start trying to do many cooldowns (kick, shieldwall, iceblock, etc) the display of your table is going to be pretty complex. You're basically just writing your own addon at that point.