As to how it works exactly? Barely a clue. I have patched a different game with it (Bloons tower defense 3), but I was going in blind and I had to use a guide (see https://asentientbot.github.io/btd3/ for that guide if you're curious).
Now that I think about it, you may not need to mess around with the code of the game itself, rather, you should edit your save file (see https://flashpointarchive.org/datahub/Save_Data_Locations for save data paths). I've never tried this, so good luck on that. However, this website seems promising (claims to edit .sol flash save files): https://www.saveeditonline.com/