How to edit update.zip to prevent fastboot removal and recovery reverting to stock?
It usually requires a new boot.img which contains your kernel..
If you flash the update, it should flash all images, Network, Boot, System, Recovery and even sometimes the Cache..
 I would imagine that you need to Patch the boot.img to work with TWRP, or other custom recovery...
Sometimes it's a simple as changing SElinux permissions off enforcing ... 

You can try to edit the recovery script because it does work on some devices, but you will most likely hit some sort of " checking update.zip is valid "... ( this usually makes a md5 and then calculates the update.zip md5 against the original )