I don't think I understand what you're trying to do, but the command to try to execute class actions with a macro is:
/ac "SKILL NAME HERE"
When last I checked, you cannot make macros that explicitly use actions that can't be assigned to the crosshotbar. So for example, with Viper's button that starts as one move but then turns into another, you can't make a macro that only calls that second move; your macro will do the same as the original button, including changing to a new move when the conditions are right.
Also, be warned that macros run one line per frame, and that unlike normal buttons, macro commands by default don't queue your action. So if you want to be able to press your macro a little bit early so you don't clip your GCD, you'll probably want your macro to repeat the line several times like so:
/ac "SKILL NAME HERE"
/ac "SKILL NAME HERE"
/ac "SKILL NAME HERE"
/ac "SKILL NAME HERE"
/ac "SKILL NAME HERE"
/ac "SKILL NAME HERE"
Each row will give you another frame worth of a window to press the button without clipping.
Hope this helps, and if you want something more specific, I'd be happy to assist if you can be more details about what you're looking for!