The P3 Pilot app allows setting the max height above takeoff at 500 meters (1640 ft). According to the manual, if you lose GPS the limit is reduced to 400 ft. Apparently the P3 will start descending in that situation. Good luck if you're 1000 feet up a mountain side, 100 feet above ground level when that happens.
At any rate, the 400 foot limit you seem to be concerned about is the FAA recommdation for "Above Ground Level" where the Phantom is located, not above the takeoff point. So you can climb hills and should adjust accordingly.