Perfectly elastic and perfectly inelastic collisions are just limiting cases on a scale of how much kinetic energy is retained. As noted in @Nathan's answer, if you work in the center-of-mass frame, a perfectly inelastic collision results in 0% of the kinetic energy retained, while perfectly elastic collisions have 100% of kinetic energy retained. So, you just need a way of scaling between those two limiting points.
In all cases, momentum will be conserved. If we choose to work in the CM frame, then it's always zero, and $ v_1m_1 = -v_2m_2 $ before the collision and $ v_1'm_1' = -v_2'm_2' $ after the collision.
Within those constraints, the actual values of $ v_1, v_1', v_2 $ and $ v_2' $ depend on the kinetic energy. KE before and after the collision is
$ KE = (m_1v_1^2 + m_2v_2^2)/2 $
$ KE' = (m_1'v_1'^2 + m_2'v_2'^2)/2 $
Then you choose the degree of inelasticity. If $ \alpha $ is the fraction of kinetic energy that's retained (so $ \alpha = 0 $ corresponds to perfect inelasticity), then
$ KE' = \alpha KE $
Once you've chosen a value for $ \alpha $, you can calculate $ KE' $ from that and the initial velocities. Given known values of $ KE' $ and 0 for kinetic energy and momentum, respectively, you're left with two equations (for net kinetic energy and net momentum) and two unknowns ($ v_1` $ and $ v_2' $), which you can solve algebraically. Then you just need to add and subtract velocities to transform in and out of the CM frame, and you're done.