We present a general perturbative method for correcting a singles and doubles coupled-cluster energy. The coupled-cluster wave function is used to define a similarity-transformed Hamiltonian, which is partitioned into a zeroth-order part that the reference problem solves exactly plus a first-order perturbation. Standard perturbation theory through second-order provides the leading correction. Applied to the valence optimized doubles (VOD) approximation to the full-valence complete active space self-consistent field method, the second-order correction, which we call (2), captures dynamical correlation effects through external single, double, and semi-internal triple and quadruple substitutions. A factorization approximation reduces the cost of the quadruple substitutions to only sixth order in the size of the molecule. A series of numerical tests are presented showing that VOD(2) is stable and well-behaved provided that the VOD reference is also stable. The second-order correction is also general to standard unwindowed coupled-cluster energies such as the coupled-cluster singles and doubles (CCSD) method itself, and the equations presented here fully define the corresponding CCSD(2) energy.