Zhang-Zagier heights of perturbed polynomials