Do you have the ability to rearrange the order here? I'd place Puerto Maldonado immediately before or after Cusco. Any flight to and from PEM stops at CUZ anyway, and it's just a 45-minute flight between the two. Backtracking to CUZ or LIM from somewhere else adds a lot of extra travel time that wouldn't be necessary if you make that change.
Now, if you visit Cusco before Puerto Maldonado, does the return from PEM get you to CUZ in time to connect elsewhere? That I don't know. If it doesn't, that would mean another night in Cusco.