MV Updating a Game Variable while in a message?

Is there a way to update a game variable while still on a message?I have a banking system I evented out and I was like to make it so that the variable can update when the NPC mentions it.

Something like:
"You want to deposit 100G?"
"Yes"
"Ok... [Update Variable]Done."

Something like that... Is there a way to do that? It's mostly a small detail and not like game breaking, but one that I would like to see. I think I can do some fun things with the knowledge at least.
it's possible, with HIME embedded choice inside windows.
than use the same message in a condition.

its a work around, but can do the trick if you want the choice
selection be visible.
There's [Yanfly's Message Eval Text plugin] that lets you run code in the middle of a message, of which I assume you could actively set the variable depending on how you were going about it.
Hakuen Studio Message Actions can also run javascript in a message window
To add to the above options, you can also do this without plugins by splitting the message into two, e.g.

Message Ok\..\..\..\^
Update the game variable
Message \>Ok...\< Done.

Since we're showing the beginning of the second message instantly, to the player these two will look identical to a single message.
Thanks for all the suggestions everybody... I'll have to play around with the different options and see what can work the best for each situation.

Thanks again

Original thread: https://forums.rpgmakerweb.com/threads/updating-a-game-variable-while-in-a-message.176087/