1. A method for modifying a function in a computer program, which is being executed by a computer system, while mitigating a change to functionality of the computer code, comprising: using a just-in-time (JIT) compilation service in a runtime environment of a common language infrastructure to compile intermediate language code, stored in memory, into machine language code that will be executed on a computer system; and using an event-based profiling agent in the runtime environment of the common language infrastructure to trap and modify a desired function in the intermediate language of the computer program prior to compilation to machine code, comprising: applying configuration data to the event-based profiling agent that identifies one or more functions desired for modification in the intermediate language of the computer program; trapping the desired function to be compiled by the JIT service by comparing callbacks of functions from the runtime environment of the common language infrastructure with event-based profiling agent configuration data; and injecting modifying intermediate language code from one or more stub methods, from a stub assembly file, into the trapped desired function's intermediate language code prior to machine code compilation of the desired function, the modifying intermediate language code comprising at least one of: prologue code to be injected directly preceding the intermediate language code of the desired function; epilogue code to be injected directly after the intermediate language code of the desired function, and arbitrary code to be injected at an arbitrary offset in the intermediate code of the desired function.