Pain is a stressor. Could be you're running yourself out of cortisol during those painful times. Try supplementing with licorice (to make your cortisol more durable, so you don't have to produce as much) during your painful periods. It could reduce the impact of pain-that-drains.