Hey guys had this problem myself and after months of playing around with it I found a solution.
# Buy a wireless charger and get enough charge on it to atleast be able to get into settings (2-3% would be enough)
# GO into settings and into battery usage
# Scroll down to ‘Recent Battery Usage’ and find the app ‘Android System’
# Tap on that and then tap on ‘Force Stop’. It had a warning that doing that could cause system problems but all it did was take away the ‘Detecting Moisture’ notification and I was able to charge again.
If you can get passed that I recommend getting a new cable, I went and bought a better one after fixing it and things were sorted. Good luck