I had the wonderful experience of the electric type shocks as well. They didn't start till about two months after my surgery. Went the first year with it happening so often I was getting almost zero sleep. Started meds second year and it has cut down the frequency. Tried many things.... Distraction, try not to focus on the shock location, loud music, exercising, reading, changing your location. Try to get you mind away if that doesn't sound to bizarre.
I'm starting to think it may be trapped gas and constipation may play a role in aggravating the damaged nerves somehow.
I wish you well and always remember while shocking, it will end.