Character stats parameters message, using Javascript

Hey everyone! I was planning on a javascript for messages.

I was also using System Text Macros and placeholder script to use a script for using 'Show Message'.

For now, I'm taking baby steps.

I used characters with parameters like Level and EXP. Here are the images below:
Screenshot 2025-08-17 142615.png

Screenshot 2025-08-17 144203.png


And here's a javascript:
JavaScript:
// Function to get a formatted stat string for any character/stat
function getStatDisplay(characterName, statName) {
    let character = window[characterName]; // Access the character object by name
    if (character && character[statName] !== undefined) {
        return characterName + "'s " + statName + ": " + character[statName];
    }
    return "Invalid Stat";

In case you need a refresh on where the code is, find this symbol --> </>
Then search for JavaScript.

I hope this is easy enough to understand.

To keep things short, click on spoilers. Don't worry, there are in fact no spoilers at all:
Spoiler: Javascript
These are created by Kentou.
JavaScript:
GameManager.characterParams[<Character UID>][<Parameter Name>] = value;
JavaScript:
var character = RecordManager.characters.first(function(c){return lcs(c.name) == "<character name>" });
    if(character) GameManager.characterParams[character.index][<Parameter Name>] = value;

EDIT: Hey guys, this is kind of embarrassing. I realized Someone like Kentou knows part of a javascript but not using macros. If they were here, I'm sure they would help out with this show message problem. I even changed a thread a bit since there isn't one about messages like this.

Original thread: https://forums.rpgmakerweb.com/threads/character-stats-parameters-message-using-javascript.179615/