New gauge showing a certain gamevariable

I'm trying to create a 4th resource. But for that I need a 4th gauge, which shows the amount of a certain variable.

So let's just assume, the resource is called willpower, the max value is stored in variable 1 and the current value is stored in variable 2.

Does anyone know, how to create such a gauge? It should show up in battle and on the menu aswell.

Thank you!

View attachment 27746

Original thread: https://forums.rpgmakerweb.com/threads/new-gauge-showing-a-certain-gamevariable.53693/