Where would I go about adding this code? Is it somewhere in rpg_windows or in rpg_scenes?
RPG Maker XP VX and VX Ace use RGSS (Ruby) code called scripts.
RPG Maker MV and MZ use Javascript.
Unless you are using VX ace now, this will not work for you.