Removing Game Overs (Like in Earth Bound)

I want my Game to have no Game Overs Like in Earth Bound, More Preciously when you fall in Battle I want you to be teleported to the inn you registered at, lose half your gold and 1 Level Up. Being teleported to the inn you registered at, losing half your gold and 1 Level Up Can be done easily in events so the easiest way to do this would be to make a Script that calls a Event. Too Bad I don't know how to do this though or where to put the Script and with parts of The Game Over Scripts to remove or modify.
Here you go.
There's also this option:

http://forums.rpgmakerweb.com/index.php?/topic/35550-no-game-over-script/
Funny Story I had the Yanfly script Hollow recommended in my game already, thanks for telling me it could do what I need. The Yanfly one sounds more like what I want and it's easier to manipulate to my needs so I'll use it instead, Thanks anyway Hudell. Edit: the Yanfly script is broken and doesn't work correctly and I was Able to get the Script Hudell put a link up for to work with a few clever events and thanks to a post of a edited version on the original post for it with made it work perfect, Thanks Hudell. Edit: Actually I ended up using the one you told the person on that thread they should use the second one you recommended, Thanks Hudell.

Original thread: https://forums.rpgmakerweb.com/threads/removing-game-overs-like-in-earth-bound.36802/