If it's not Verizon or AT&T, you may be able to flash a 4.4.4 (or even 4.4.2) ROM - see
[Samsung] How to flash Stock ROM via ODIN. (Since it's the ROM that's rooted, rooting a ROM you're about to replace is a waste of effort.) Verizon and AT&T Samsungs (it may be true of others, I don't know) have a version fuse - once they're blown to 5, you can't flash 4. If you're at 4.4.4, you can flash 4.4.3, but flashing 4.3 isn't possible (different bootloader, and it's locked, so you can't replace it).