That's a holdover from Pokemon, and is implemented there (and here) to ensure any fight against a higher level opponent isn't a certain loss for the lower level mon.
Perfectly static systems like that with no RNG can work, BUT they require a lot of complexity to make them fun to tinker with. Fun stops when the learning does after all. Corrupted Saviors is a good example of what a well-tuned static combat system looks like in action, and while I love that game to bits, it's dense as fuck and would make a poor match with this game's vibe and direction.
Edit: Should I interpret that as you adding some Rubberbanding, Devil? Or was it just a misplaced/misvalued variable?
Nothing was actually wrong with the code itself, just tweaked a value that set the maximum chance the enemy has to dodge when you attack. The actual line of code is a bit more complex than a simple rng roll obviously, but to boil it down to simple odds.
1 miss = 10% = It'll happen here and there.
2 miss = 1% = It's going to happen eventually, but so rarely that you probably wont recall the last time it happened.
3 miss = 0.1% = About the same odds of cracking an egg with a double yolk. Yes I'm looking up random stats at this point.
4 miss = 0.01% = Approaching "struck by lightning at some point in your lifetime" level of odds.
5 miss = 0.001% = idk, you angered an old god or something. Its literally a 1/100000 chance.
Something that kind of never gets talked about is that the game in its entirety is stacked heavily in the players favor already. Capture chance is higher than what's labeled on capture items. Enemies never use heal items. Chances of you characters dodge are higher and only get higher the less health you have. Player monster level cap is like 3 levels higher than wild monster level cap. Things like that everywhere in the battle system. Basically, we do understand the need of tweaking and twisting the numbers behind the scenes to make the battle system 'okay' at least. We have two audiences to please with this, people playing the game and people beating off to the game, so there isn't a perfect middle ground.