Longitudinal phase-space manipulation with beam-driven plasma wakefields