Hello, welcome to the MV!
Well, as I understand it, you want a graphic bar on the screen to count the amount of sanity.
As you are new I recommend a Galv plugin that I've used a lot:
FEATURES A graphical bar that displays in the map scene to show the current value of a max value visually using graphics based on 2 separate variables (for current and max values). VERSION 1.0 R…
galvs-scripts.com
In addition to the plugin, there is a demo download with some things ready for you to understand how everything works.
There is also this Moghunter plugin that in addition to the bar it also shows a persistent number on the screen:
Ver 1.6 – Last Updated 2019 / 02 / 04 File Name – MOG_VariableHud.js DOWNLOAD CARACTERÍSTICAS Apresenta as variáveis ou itens através de Huds. UTILIZAÇÃO Grave as imagens na pasta /img/variab…
atelierrgss.wordpress.com
Good design! : v