The math is not too difficult, but rather boring.

The close up lens shortens the focal length, but the lens to film distance remains the same. That means a now shorter focal length lens is sitting relatively (but not absolutely) further away from the film = you are focused to something closer.

Now if you would simplify things and assume that the focussing distance is the lens to subject distance, you can approximate the lens to film distance using the classic lens formula 1/f = 1/lens to subject distance + 1/lens to film distance.
Next you calculate the focal length of the lens combined with the diopter (turn the focal length into diopters, add the diopter power of the close up lens, and turn the result into a focal length again).
The using the lens to film distance and the calculated combined focal length, the lens to subject distance is calculated using that classic formula again.

It's a simplification that only produces an approximation. But it gives an idea of how to go about it. If you are really going to do this, you probably have enough enthusiasm for it to figure out how to find out what the internodal distances of your lenses are, how to get from the subject to film (i.e. focussing) distance to lens to subject and to lens to film distances, and get results that are close enough to produce good enough resukts when you set up using a tape measure.