Samsung S4 logo shows for 1 sec then phone boots and repeat. Pressed the power button for Samsung S4 and the logo comes out for 1 sec then phone boots again or shuts down. I cannot go into recovery mode or download/restart mode using the volume, home, and power button as it just shows the samsung logo for 1 sec then shuts down. However after charging it, it can go into recovery mode in which I tried wiping the cache and doing a factory reset. After rebooting the system in recovery mode, it enters recovery mode again if the s4 is charging. When taking out the usb, the logo shows for 1 sec then shuts down. Please help as I've tried everything. I have stock 4.4.2 ROM.
Take out your device's battery and wait for 10 seconds. Press the power button for 45 seconds and then install the battery.
If the first method didn't work, try to enter "Download mode" like this:


Turn off your phone; 
Connect your phone to your computer and then hold Volume Down and Home button.