you know when you Right-Click over an object you get a context-sensitive marking menu (allowing you to switch to component modes) with a lower menu something like this:
well, I wanna modify the component mask commands, remove "UV Sets>" and "Paint>" items, add a NEW command to this menu and some other crazy stuff but I can't find the MEL script(s) for this marking menu so I'm obviously having trouble putting my own MEL commands into it...
have a look at the Xumi scripts. they have a lot of context sensitve menus (they might even take over the right click menus- i dunno). they might give you some ideas about where to find the menus... cheers.
Yes you can its only a mel script (Almost the whole, ~99%, maya ui is a mel script and also just a demontration on what you can do). So turn echo on etc and hunt this file down then copy it to your own scripts directory (this will overide the maya defaut for you only, trust me its much smarter thisway bcause otherwise you can easyly break maya). Then do your changes on this copy.
Do a search in the MEL scripts for STORC. I built this off of Naughty's work and it allows you to customize the RC menu using shelves. It works under Maya5 and I have found it very handy. If you need to get more in depth just look at what Naughty and myself have done in these scripts to see how it is done. It is pretty well commented and both of us hang around here if you have questions.