The cookie recipe calls for 2 large eggs and I only have medium. Is there a way to make up for the egg loss or substitutions?
There’s a good chance that the difference of what will be perhaps half a tablespoon just won’t matter in the final product. You don’t say what exactly you are going to make, but if your recipe was so sensitive to minute inaccuracies, it would probably be weight-based for all ingredients, including the eggs.
If you really feel your batter is too dry, add a small amount of liquid (milk or whatever fits your recipe) and you should be fine.
Just reduce the amount of the other ingredients slightly. For cookies, mainly this just means a little less flour. A little more or less butter and sugar doesn't make much difference - you just don't want the mix too dry. Take out a spoon or two of flour from what you measure, and you should be fine.
Although for many things, you can get away with some imprecise measurements, when baking the difference in moisture can be quite significant, so for that you may want to use fractional eggs.
For the US, a large egg is around 2 oz, while a medium egg is 1.75 oz. So you would need 2 2/7th eggs, or just a bit more than 1/4th of an egg.
For the UK, we're looking at the difference between ~68g vs. ~58g, so about 2 1/3 eggs.
For Australia, we have a larger difference, as it's ~43g vs. ~52g, so you'd need roughly 2 2/5 eggs.
In North America, the minimum size for medium eggs is around 50 grams, and the minimum size for large is around 57 grams, so only seven grams per egg. That means that if a recipe calls for eight large eggs, using medium eggs would leave you about one egg short. Therefore, for a North American recipe, you should add one medium egg for every eight large eggs the recipe calls for.
The European sizes are 53 and 63 grams, respectively, or ten grams of difference per egg. So, in European terms, you should add one egg for every six large eggs when substituting medium eggs for large.
So, in conclusion, unless you are making very large batches of cookies, you don't really need to worry about the size of eggs. This sort of arithmetic might be more useful in the case you are using small eggs instead of large ones.