Simplest way to modify the engine code?

The easiest way might be cloning the Engine from Github and changing whatever you want to change and compile it.

https://github.com/EpicGames/UnrealEngine

Another approach might be creating a custom Engine, this is a short tutorial:

I hope it helps.