We extend the new perturbation formula of equilibrium states by Hastings to KMS states of general $W^*$-dynamical systems.