Okay I think I have something you can try:
PF --> Displacement Shader to Scalar converter
Displacement Shader to Scalar --> converters for x, y, and z
Y to scalar --> Conditional scalar; the conditional scalar is an if/then mechanism, so create a constant scalar for your top height ("top Y value" in the image), and set the conditional to yield the original Y to Scalar value if the Y to Scalar value is less than or equal to "top Y value", and the ELSE clause to be the "top Y value". Then plug that result, plus the X and Z scalars into a "Build Vector" node. Plug that into a Vector Displacement shader, and plug that into whatever - in this case it's the warper and compute terrain nodes from the default scene.