That's a long list of scenarios, I'm not going to cover each one in detail.
Basically, re-calculate your score for the day the original vote was cast on, without that vote. It is gone from that day, as if if was never cast. This means you re-apply any capping rules, etc.
Then do the same for the day where the vote was re-cast (if it was re-cast), it as an entirely new, independent vote. You got a vote on that day, it counts towards the cap, etc.
The 'un-upvote' entry in your reputation history is only there to help you understand the history of the votes (to answer the question why did I lose a vote for that post questions).
You want to look at your reputation audit log at https://stackoverflow.com/reputation
to see the actual reputation accounting. theThe reputation changes you see in your reputation history tab reflect the reputation loss for the un-upvote on the day that it took place however, as if the actual recalculation can't go back in time to correct the record.
Note that the rep cap can't be lowered by un-upvoting; your history is just re-calculated including the actual caps.