It is well known that the total energy is a suitable Lyapunov function to study the stability of the trivial equilibrium of an isolated standard Hamiltonian system. In many practical instances, however, the system is in interaction with its environment through some constant forcing terms. This gives rise to what we call forced Hamiltonian systems, for which the equilibria of interest are now different from zero. When the system is linear a Lyapunov function can be immediately obtained by simply shifting the coordinates in the total energy. However, for nonlinear systems there is no guarantee that this incremental energy is, not even locally, a Lyapunov function. In this paper we propose a constructive procedure to modify the total energy function of forced Hamiltonian systems with dissipation in order to generate Lyapunov functions for non-zero equilibria. A key step in the procedure, which is motivated from energy-balance considerations standard in network modeling of physical systems, is to embed the system into a larger Hamiltonian system for which a series of Casimir functions (i.e., first integrals) can be easily constructed. Interestingly enough, for linear systems the resulting Lyapunov function is the incremental energy, thus our derivations provide a physical explanation to it. An easily verifiable necessary and sufficient condition for the applicability of the technique in the general nonlinear case is given. Some examples that illustrate the method are given.