Battle encounter variables. Help?

First of all, let me give two examples of my design concept:

1) Surprise boss battle that has a certain percent chance of happening, (even a random 50/50 split would be a start,) but only when the player walks over certain tiles on the map. In my case, think of a snake-like creature who is moving around through tall grass tiles, and invisible to the player. As long as the player isn't on one of those tiles, there's no chance of an encounter with this boss.

2) The boss is unbeatable during this section, making escape or failure the only options. To ease the frustration level, I want to create a high % chance that failing to escape and having your HP hit 0 in one attack isn't an automatic game over.

I have a decent understanding of basic switches, but I'm not even sure where to start with these kinds of variables. It seems much more complex from what I'm seeing in the event menus. I tried "Battle Processing>If lose>Control Variables, but I didn't have any success playing around with it. Any helpful tips or even a link to a good tutorial would be greatly appreciated.
I suggest you follow the link to the starting point in my signature and work through the tutorials there.
It links to a lot of tutorials including tutorials on eventing and to the variables guide - which are the two things you'll need for this.

basically your variables need to be used and checked before the battle processing, not after - and any percentage check needs control variable plus conditional branch, nothing else.

But I suggest you take a month to work through all of the tutorials I linked - it seems as if you're really new and there are a lot of details that you can't find out by guessing but would speed up and improve the quality of your game development if you learn them at the beginning.
And no, no one can learn all that in a day of simply reading a few pages of tutorial text, you need to work through those tutorials with a practice project that will be scrapped after a month.
Thank you for the reply. From your link:
Variables are the most important part of any quest that is to be more than a simple “go there”, and you need to understand them before working on any advanced game.
That certainly tells me a lot. I thought I was just missing something simple. No wonder I couldn't find any quick tutorials on the subject. Well, I guess I have a lot to learn. Sorry for the noob question!

Original thread: https://forums.rpgmakerweb.com/threads/battle-encounter-variables-help.104970/