If a Pokemon is hurt from confusion during the semi-invulnerable stage of Fly, Dig, or Dive, the move will be disrupted, and will come out from being hidden. Therefore, the Pokemon using Fly, Dig, or Dive will not have its PP deducted, as the move didn't fully execute.
Source
Hope I helped! :)