So I've tried every possible trick I know from stack walks and proxy objects to prototype pollution and json injections to get access or expose something in the game code's local scope and... nothing (well done!) 😅
I'm left with no choice but to suggest implementing some kind of modding support, be it a full blown API of some kind or just exposing some of the game's variables (and/or methods) in some accessible scope.
For this game and in these circumstances, I would probably implement it like so that one must explicitly enable modding with some setting, which is saved with all of the other player data, and if that setting is set to true when loading a save then some variables would get exposed.