If you compute the barycentric coordinate of $p_4$ with respect to $p_1,p_2,p_3$.
i.e the three numbers $a_1, a_2, a_3$ such that
$$a_1 + a_2 + a_3 = 1\quad\text{ and }\quad p_4 = a_1 p_1 + a_2 p_2 + a_3 p_3$$
$h_4$ will be equal to $a_1 h_1 + a_2 h_2 + a_3 h_3$.
To compute $a_1, a_2, a_3$, you can use the fact they are proportional to the area of triangles $\triangle p_4 p_2 p_3$, $\triangle p_4 p_3 p_1$ and $\triangle p_4 p_2 p_3$. More precisely, if $(x_i,y_i)$ are the coordinates for $p_i$ where $1 \le i \le 4$, we have
$$a_1 : a_2 : a_3\; = \;
\left|\begin{matrix}
x_4 & y_4 & 1\\
x_2 & y_2 & 1\\
x_3 & y_3 & 1\\
\end{matrix}\right|
:
\left|\begin{matrix}
x_4 & y_4 & 1\\
x_3 & y_3 & 1\\
x_1 & y_1 & 1\\
\end{matrix}\right|
:
\left|\begin{matrix}
x_4 & y_4 & 1\\
x_1 & y_1 & 1\\
x_2 & y_2 & 1\\
\end{matrix}\right|
$$