Downsampling in Matlab simple example
You are removing the scaling effect yourself when you perform the following operations:

Pd = abs(Yd/Ld)
P = abs(Y/L)


If you don't divide by the length, then you'll see that one has half the amplitude of the other.