My experience thus far indicates that the Z Move is a completely separate move from the base move it is modifying. The base move is only considered for the Z Move's Power, and whether it ends up being Physical or Special (leading to Defense or Special Defense on the target). But I can't really confirm that. In my story playthroughs I rarely use stat altering moves.