Say my mom has a gene (it's one of those regular gene, ignore X and Y chromosome)
The gene exist in p% of the population.
Things get complicated due to that p. If p is 100%, for example, then of course the probability that I have the gene to is 100%. If p is 1% then the probability that I got the gene will be 50%.
How to formalize this mathematically?
My gut feeling is it'll just be linear. if p is 1% then my chance will be 50.5% because that means my dad have a 1% chance to have that gamete.
Then i want to extend this to cousins.
First by 'gamete', you mean allele correct? A gamete is when the sperm and egg have already fused together so there is no more probability. While an allele is a specific gene which can vary (as in your case). So I will assume that you are talking about an allele/gene.
In your case, the formula, that you are talking about is the Hardy-Weinberg formula.
Basically $$(p^2) + (2pq) + (q^2) = 1$$ where p and q are the percentage of two version of the alleles.
Say you have a gene with 2 possible alleles 'A' and 'a' which are present in p% and q% of the the population (so p would be 1% and q can be 99% in your case).
The percentage of the three possible genotypic frequencies in the offspring become:
$f(AA) = p^2$
$f(Aa) = 2pq$
$f(aa) = q^2$
To find the chance that you will get an allele A, you just need to add up $f(AA) + f(Aa)$ (because both of them have a gene/allele 'A' which is the gene that you want to know about)
If your case, if p = 100% = 1, this means $q=0$, then the probability that you will be an allele A would be 100% (because $f(AA) + f(Aa) = 1^2 + 2*1*0=1+0=1$).
In your second case, If p = 1%, this means q = 99% (because all the other eggs would have the other gene/allele). This means $f(AA) + f(Aa) = 0.01^2 + 2*0.01*0.99=0.0001+0.0198=0.0199$ or 1.99%.