I can't tell how much water damage there is from the inside photo it is dark, but I would remove all the old caulking and the old skylight separate the laminates( rubber roof, Styrofoam, wood) and look between them to see how rotted the wood is an how far back it extends. Are the headers sound and is the area around dry? If the area is wet insert some wedges between the laminates and allow several days to dry in the sun with a tarp over the hole. A heat gun from the inside can speed up the process. Very thin epoxies are sold such as Git-Rot that will soak into the rotted wood and restore strength however you can thin any epoxy resin with some acetone to do the same thing. I would use 4 pieces of pine board on the outside and 4 on the inside held with 8 C-clamps to compress the laminates together while the resin is curing. Hope this helps. Good luck and let us know how you are doing.