Is my battery pretty much dead or is my charging port broken?

A

AC Question

Alright. So, I've tried to look up information on this and I can't find anyone who has had this exact problem...
I should start by saying I used to be able to charge my HTC One M8 with any charger (cable and plug) but recently it has been acting up. I don't know if I should get the actual HTC charger because I don't know if it will end up being a waste of money (I have very little because I go to college full-time)
To go into detail, about a week ago, my phone died while I was watching a movie, so I got my charger, turned my phone on, and plugged it in so I could use it while it was charging (I always keep my phone on when I am charging it). It started optimizing my apps and then died immediately after. After that the charger wouldn't keep it alive long enough to really turn it on all the way. I repeated those actions about three times (it optimized partially once after the first time) before I just let it turn off and charge. When I turned it after I woke up in the morning, everything seemed fine until I got a text from a number that I found out to be my friend...but I could only see their number...I checked the other chats and I realized that all my contacts were deleted. Every single one. I eventually figured out how to get them back but the issues don't stop there. I started having terrible battery life. Fast forward two nights later; my phone dies again. I try to turn it on once and charge it thinking it would be fine, it did the same thing it did the first time so I just let it charge. In the morning, I turned it on and everything seemed fine. It wasn't until a couple hours later that my Verizon Messages app stopped working. I kept getting a message on it (I don't remember what the message was) every time I tried to open it and it refused to open. I decided to just use the other default texting app on my phone even though I'm not a fan of it. Okay, so then the next couple days, my phone would not charge very much throughout the nights and the battery life would be horrible while it was charging/not charging. I would constantly get the messages saying to use a different charging or that it wasn't charging fast enough so yesterday I decided to back up all my pictures, videos and so on onto my PC and system reset my phone. After quite a few hours it finally finished resetting. It turned on and things seemed okay. I got all my contacts, pictures and videos back from the Cloud and deleted all of the videos and most of the pictures. I was able to use the Verizon Messages app again. It seemed peachy until this morning. It had been charging all night and was only at 22%. ( I used to close apps once in a while by the way and lately I have been closing all apps multiple times a day...just thought I would add that in there.) I had maybe two apps redownloaded onto my phone...Instagram and Bingo Blingo because I use those the most. I have been using my phone all day today and charging it the best I could before classes and it died one time during school. It has been on the charger ever since I got home and it charges on and off, it seems as though i have to bend the wire sometimes, and I can't move it around all too much or else it stops charging. It died about a half hour ago and I left it off. Somehow it is charging rather quickly now. It is at 50% but I feel like I have to stay awake for fear that it will stop charging. I need my phone while I am at school so I need it to be fully charged. I can deal with not having an alarm but this has been very obnoxious. Please help!!!