My suggestion is similar but a couple of other things you could try is
1) Airplane mode if you are 20% or below. You shouldn't have to be without communication and still have your phone on.
2) Clear your recent apps by holding the HOME button and clear then all.
3) Navigate to your data settings and press the menu button (it's left of the home button on the S4) and choose to turn off background running apps. This will make all of the apps that remain active even when you don't use your phone to stop draining your battery. BUT DON'T FORGET TO TURN THEM BACK ON once you have a sufficient amount of battery life
4) Data network uses more battery than WiFi so if you have access to WiFi use it and turn off your data. Don't worry you'll still be able to make and receive your calls, text, etc.
5) You can also try booting up in recovery or safe mode. Shut off your phone and... Actually Google that part and enter your model and make of your phone to get the accurate instructions on how to do it correctly.
6) Last under the absolute worst case scenario that none of the other steps have seem to work for you. Before buying a new battery or phone you could do a factory reset. This will delete all apps that aren't one of your pre-installed apps. Don't worry, you can back up everything first through Google by syncing your phone it will save all of your data. ALL of your data basically. Also you can backup with your Samsung account. Once you get that done simply shut off and when you power on press the volume down and power buttons at the same time until you see the android robot screen and choose WIPE PHONE. Confirm your decision and give it a few minutes to do its job and it'll restart automatically and begin to restore your phone if you are connected to WiFi. But don't do that yet. Let your phone completely charge normal with all of your usual settings going. This will let you see that it was clearly an app draining your battery or if indeed your battery is shot.
Best of luck. If this doesn't work then you did it wrong lol