Sorry, but, I simply can't help with your problem. See, that ... thingy (?) ... below my avatar is (in all reality) a misnomer. It started with a addon (I wouldn't really call it that, but.....) I did called "Masque_ClassButtons" ... and snowballed from there. I really don't know how to write Lua. Oh sure, I can "fake it", mostly using "copy-n-paste", but when push comes to shove, I'm lost. I managed to cobble together a few Minimap Button Frame plug-ins (not too hard once you get one working correctly), and a few more for Masque, but that is the extent of my Lua knowledge.
Sorry, I tend to ramble on the last .... uhm .... while.
In all reality, the hardest part of my plug-ins was the graphics. The Lua stuff was relatively .... easy.