the command to assist someone, which is what you are referring to, is /assist <name> (put the name of the person you are wanting to assist in place of <name>). to set up a macro, just do a single line command using that command, or you can use /toggleautoattack, or /useability <ability name>, or something along those lines as a second line after /assist.
hope that helps.