Add message to battle log via script call?

Hi! I have a skill that plays a common event every time it's used and I'd like for it to display a battle log message for when it does so.
To go more in depth, the skill switches the actor from "DEAD" and "ALIVE" status depending on which one is active currently, and I'd like it for the battle log to say "Lazarus is now DEAD" if it goes to the "Lazarus has ALIVE status" conditional branch and vise-versa. How may I do this?
I think you need a plugin like Eli/Hakuen Studio Message Actions for this that will change the battle log dialog based on a switch.
If you just want to add a message to the battle log via a script call in your common event, I don't see why you can't call the log window's methods directly.

JavaScript:
const text = "My message"
BattleManager._logWindow.push("addText", text)
BattleManager._logWindow.push("wait")
BattleManager._logWindow.push("clear")

Be sure to use all 3 lines; the "wait" and "clear" are essential to retaining the default flow of the log window.

Original thread: https://forums.rpgmakerweb.com/threads/add-message-to-battle-log-via-script-call.162272/