You're right that the Hamiltonian you've provided is incomplete, you need to include the fact that there's an impenetrable barrier underneath the ball (i.e., the "floor"). As a result, your potential energy can't be a smooth function, but would rather be something like:
$$V(y) = \begin{cases}mg y \quad &y\geq0 \\\infty\quad &y < 0\end{cases}.$$
The Hamiltonian for the system would then just be $$H = \frac{p^2}{2m} + V(y).$$
In the case of such problems it's usually much more convenient to model the barrier as a constraint rather than as a potential. But nevertheless, the potential will be as shown below (left), and I'll leave it to you to show why the phase diagram looks like the image on the right (ask yourself what happens when the ball hits the floor, and it should be clear).

In the diagrams above I've assumed units in which $m=1$, $g=1$, and that the ball is released at a height of $y=2$, so that its total energy is $E=2$ in these units.
To find the "action" variable, you'll need to calculate $$J = \oint p \text{d}y = \int_\text{Going down} \text{(something)} + \int_\text{Going up} \text{(something else)},$$
where I'll leave it to you to find the appropriate limits and integrand.