There's a few addons out there that will help out hunters with Misdirect, but no love for the rogues! Took the liberty of throwing together a quick and dirty mod that does the following:
-Dumps a Raid Warning for you when tricks is applied to a target
-Sends the target a tell when you hit a mob and actually start the misdirect. There's a warning included if you're over 50% threat (but not to tanks) and includes the % threat.
-After tricks expires, dumps in chat how much damage you did over the 6 seconds.
-Warns you when someone applies tricks to YOU (dumps a raid warning and i borrowed a sound from bigwigs)
I'm by no means a good coder. The code itself is probably inferior in regards to efficiency compared to other mods that parse combat events. I'd love if someone could help me out with cleaning up the addon and adding a few features:
-A timer bar to show the cooldown and duration both on outgoing and incoming tricks. Possibly cooldown tracking on other rogues in your party/raid?
-Optional integration with SharedMedia for textures and sounds
-Integration with LibSink to control output of warnings
-An options panel (preferrably ace3) to tie it all together
Frankly, I'm embarassed to post my code around here in the state that it's in. I would be greatly appreciative of anyone who could take the time to help me complete this addon.
Looked over your code (glad I could inspire something :P), and it looks good, not sure why you'd be embarrassed by it, but I guess we're all a little self-conscious of our first addons.
Only thing you might do, and I'm sure somebody will disagree with me, is to make a local reference to the Blizzard functions you call in your CLEU handler. It's a minor speed thing since local vars don't require the table look-up and shaving any time off a combat log handler is a good thing.
So at the top with your other locals just something like:
local UnitDetailedThreatSituation = UnitDetailedThreatSituation
local UnitExists = UnitExists
local mfloor = math.floor