The way I have always done this is to add my code to the official files. Is there another way? I always add my stuff at the very end of the file.
I looked it up. Going to try it now. I prefer that method to mucking with my game files anyway. Reminds me of days long past where you just copied a mod folder into the core Quake/Quake II/Half-Life/Unreal folder and things worked.