combining weighted p-values across multiple studies

I am not someone who is extremely familiar with statistical theory so I have had to do a lot of reading to arrive at these ideas. I am basically attempting to combine p-values across a series of studies while maintaining these p-values weighted by sample size and by function.
I have five identically distributed but not independent variables, some having different levels of correlations to the others. These variables represent different studies which consist of identification numbers (ID #s) and ID # each has an assigned p-value.

So in essence, for one study, I have about 5000 ID #s and 5000 corresponding p-values.
For all the other remaining 4 variables, the 5000 ID #s are the same as in study 1 but the p-values differ.
I am using a p-value product method to combine p-values, however my questions lies in this:
Each study has a different sample size, we used 500 people in study 1, 1200 in study 2,…..300 in study 5.
On top of that, the ID #s can be categorized into different groups based on importance (importance levels rank from 1-10).
My question is, how do I weigh this product of p-values by the sample size and the importance of the ID to obtain a final p-value product that is representative of each study?
I plan to use permutations to obtain empirical p-values.
Please point me to a research publication that covers this “weighing” issue if it is not too much of a hassle or please help me with this.