how do you stop the battery animation, which appears when the phone is turned off and the cable is connected or d disconnected? I am using rooted touchwiz on an s5.

Someone asked why disable them. I have a bike charger which occasionally puts out power for a few seconds and then cuts out repeatedly. So the animation comes on, which drains a little bit of battery, and then disappears. This cycle repeats, and results in the battery actually losing power.
Under /system/media you should see some files whose names contain "battery" and end with .qmg or .spi (depending on your Android version). Moving those files elsewhere (for backup purposes do not just delete) should get rid of the animation.

Do back up before you fiddle with /system, though.

What I don't get is why you want the animations disabled. Does it do anything bad for you?