This isn’t difficult if you use the numerical window IDs which you can find by looking at the Preferences>Utilities>View Window ID slider while mousing over the button. To find what state a button is in you can use the IGetFlags command, testing to see what flag is returned for what state. Then it is a simple matter of setting up a loop to find the button that is on, switch that off and the next on, with an If statement to return the cycle to Std:
[IButton,"Brush","Set Edit brush mode",
[If,[IGetFlags,Transform:Edit]=9,//checks that in Edit mode
[Loop,8,//loop to find current mode
[If,[IGetFlags,[Val,n+1072]]=9,[LoopExit]]
,n]
[If,[Val,n+1072]=1079,[ISet,1079,0][ISet,1072,1]//set Std ON if Nudge
,//else
[ISet,[Val,n+1072],0][ISet,[Val,n+1073],1]//set next ON
]//end if
,//else
[Note,"No 3D object in Edit mode."]
]//end if
,,,'1']//hotkey
You’ll note that the layout of the buttons is not quite in numerical order so the cycle is not quite as you’d expect, and I’ve ignored the Morph and Morph Dot buttons which would need extra coding as you have to have a Morph Target stored before they become available.