MV Remember last choice

OK, here is my problem.
I'm using the show choices command to make a small extra menu.
Is there a way to remember the last choice the player took?
For example if he took choice 2, when he returns to the choices command window, choice 2 is highlighted.

That brings me to the question: Is there any way to make the choice window highlighted the choice that I indicate? (only with that I think I'll be able to do it)

For example: I created a variable.
If option 2 is selected the variable becomes 2.
Before showing the choices window again I check if that variable is 2 and then highlighted the choice 2.

I explained myself well? English is not my language. If you don't understand me, I can continue explaining.
🙂
I can think of two ways to accomplish this. Sadly both are a bit convoluted as the default editor only allows you to set a fixed default choice in the show choice event command.

The first method uses pure eventing. Setup your choice like this:
Code:
◆If:Previous Choice = 1
  ◆Show Choices:A, B, C (Window, Right, #1, -)
  :When A
    ◆Common Event:A branch
    ◆
  :When B
    ◆Common Event:B branch
    ◆
  :When C
    ◆Common Event:C branch
    ◆
  :End
  ◆
:Else
  ◆If:Previous Choice = 2
    ◆Show Choices:A, B, C (Window, Right, #2, -)
    :When A
      ◆Common Event:A branch
      ◆
    :When B
      ◆Common Event:B branch
      ◆
    :When C
      ◆Common Event:C branch
      ◆
    :End
    ◆
  :Else
    ◆Comment:...
    ◆
  :End
  ◆
:End

The other method would be to head over to the script call list ( ) and take a look at how to setup a show choice with javascript instead of an event command. Then you can simply pass the value of your variable saving the previous choice as the defaultIndex parameter.
Thanks! @eomereolsson
I also came up with option 1 you gave. I'll try option 2 too and see which one works best for me.
Although I wish there was some script called for just changing the highlighted choice.
Sadly a single script call is not possible, as the choice setup from an event command happens all inside a single function Game_Interpreter.setupChoices. To have a chance to modify only the default selection and leave the rest to the standard execution you would need a plugin to hook into that function.
I understand, I'll see if I ask for a plugin, I think it would make everything easier for me.
Moved to: Plugin Requests

Original thread: https://forums.rpgmakerweb.com/threads/remember-last-choice.150456/