I imagine (haven't really tried it) this would work, with some minor adaptation to match your code structure.
// VBUS or counting frames
// Any frame counting?
u8 f = UDFNUML;
return f != UDFNUML;
The method reads the UDFNUML - usb data frame number lower (byte) register, waits 3 milliseconds, which would be ...