Proof (maximal dimension of totally isotropic subspace)

Take $B = \set{v_1, \ldots, v_n}$ so that $[\phi]_B = \pmat{I_p \\ & -I_q \\ && 0}$. Assume $p\geq q$.

The subspace $$ \begin{align*} T = \langle v_1 + v_{p+1}, \ldots, v_q + v_{p+q}, v_{p+q+1}, \ldots, v_n\rangle \end{align*} $$ is totally isotropic with dimension $n-p=n-\max\set{p,q}$.

$U = \langle v_1, \ldots, v_p\rangle$ is a subspace such that $\phi|_U$ is positive definite. If $T'\leq V$ with $\dim(T')>n-p$, then $\dim(T') + \dim(U) > n \geq \dim(T' + U)$ so by the sum-intersection formula, $U\cap T' \neq \set{\v 0}$. Hence $T'$ is not totally isotropic.