This talk considers highly oscillatory Hamiltonian systems with a slowly varying, state-dependent high frequency. The
long-time behaviour of the St\"ormer--Verlet--leapfrog method is studied using an extension of the technique of
modulated Fourier expansions from a constant high frequency to a state-dependent high frequency.
It is proved that the St\"ormer--Verlet method approximately conserves a modified action and a modified total energy over
a long time interval that covers a negative integer power of the small parameter. This power depends on the size of the
product of the stepsize with the high frequency.
This is joint work with Christian Lubich.