Change party formation with a button press

Hello and thanks for looking! I need a really simple (hopefully) script. Say you have a game with two characters, lets call them X and Y. I need a script that changes their formation with the press of a keyboard button (Q). Hopefully these images are clear enough:

R2orJ8e.png

X is in front. The player presses the Q button on their keyboard.

BjXjfTO.jpg

Now Y is in front!

R2orJ8e.png

If the player presses Q again X returns to the front.

In other words, exactly what the change position in the default menu does but with the press of a button. The party will never have more than two characters.
Are you using any party plugin already? If not this one should work:

http://mvplugins.com/plugin/PrimeHover/PH - Swap Party
Are you using any party plugin already? If not this one should work:

http://mvplugins.com/plugin/PrimeHover/PH - Swap Party
Is there a vx ace version of this?
Is there a vx ace version of this?
Oh. Im so sorry. Missed the thread. I've done something with script calls myself before for vxace but cant remember well how to do it. Basically you need to remove the first party member and add it back, however so long i dont touch vxace that i cant tell you exactly what to do.

EDIT:
I would create a parallel common event and put a conditional inside for the key you want to press for it. Inside the condition a script call with this:

Code:
temp = $game_party.members[0].id
$game_party.remove_actor(temp)
$game_party.add_actor(temp)

Not sure if it will work as I dont have VXACE anymore to test it for you.
If you use Yanfly Party system script, then Soulpour has a fix to allow party swap.
By using script call $game_party.swap_order(n,n)
Himework's Rotate Formation, which uses A and S to rotate party formation. Simply #comment out one of the calls on the bottom if you want only one button.
@Harosata

Exactly what I was looking for! I actually managed to solve it myself by following @GuanyuMaker suggestion and using a common event, but the script should still be super useful for someone else having a set-up like this.

Original thread: https://forums.rpgmakerweb.com/threads/change-party-formation-with-a-button-press.93835/