I used this for my MMU3 setup with an 0.6mm nozzle. You can get the custom g-code out of the Layer-End Section. Follow the original steps, use this equation to solve for your frequency:
15 * [ (1 + (5(z) - 2) ) / 99 ]
The author remixed this model.
You can use this file, if you have an alternative setup with a different nozzle or material.
MMU3 works too.