Let $H(z)$ be a Hamiltonian and $\omega_{ij}$ the symplectic form on the phase-space and $\omega^{ij}$ its inverse $\omega_{ij} \omega^{jk} = \delta^k_i$. We know that the Hamilton's equations are then given as $$\dot{z}^i = \omega^{ij} \partial_j H$$ In canonical coordinates $z\to p_i,q^j$ we just have $$\omega^{ij} = \begin{pmatrix} 0 & -\mathbf{1} \\ \mathbf{1} & 0 \end{pmatrix}$$ and thus the usual coordinate form of Hamilton's equations and the Legendre transformation $$L = p_i \frac{\partial H}{\partial p_i} - H(p,q)$$ However, there exist systems (one example would be a Hamiltonian for spinning tops) where $\omega^{ij}$ cannot be globally put into the canonical form given above. How does one then execute a Legendre transform?
In other words: Is there a closed general formula for a Lagrangian $L$ in terms of $H$, general phase-space coordinates $z$, and the symplectic form $\omega_{ij}$?
To add some context: What I want in fact is to write the action on the phase space $$S[z(t)] = \int p_i \dot{q}^i - H(p,q) \mathrm{d}t \,,$$ where $\dot{q}^i$ is not given in terms of phase-space variables. This is then useful in the variational approach to symplectic structure as discussed e.g. by Marsden et al. (1986).