Partial answer: no healing
In your case the healing is the culprit, which makes the whole thing extremly hard to calculate. I hope my equation for the special case of h = 0 (no healing) helps you along the way.
Minimum amount of shots required \$n_{min}\$ (all shots hit)
$$
n_{min}= \lceil\frac{x}{d}\rceil
$$
Chance for a killing sequence of only hits (\$n_{min}\$ shots and all hit):
$$
P(n_{min}) = p^{n_{min}}
$$
Chance for a killing sequence with \$k\$ misses (\$n_{min} + k\$ shots)
$$
p^{n_{min}}*(1-p)^{k}
$$
Since the missed shots can happen anywhere in the sequence, we have to multiply this by the number of possible permutations. Since this is a form of Binomial distribution this would be:
$$
{n_{min}+k \choose n_{min}}
$$
But this contains also permutations that end in one or multiple missed shots, where the target would be already dead before the end of the sequence.
So lets only account for those permutations that end in a hit. With one event fixed we have to substract 1 from top and bottom.
$$
{n_{min}+k-1 \choose n_{min}-1}
$$
This leads us to the formular to calculate the chance to need any amount of shots to kill the target.
$$
P(n_{min}+k) = {n_{min}+k-1 \choose n_{min}-1} *p^{n_{min}}*(1-p)^{k}
$$
To get the average number of shots required, we multiply each chance with the amount of shots and sum everything up. Since it is possible to miss indefinetly, it is an infinite sum with ever shrinking summands.
The average number of shots neccessary (\$n_{avg}\$)is :
$$
n_{avg} = \sum_{k=0}^\infty( (n_{min}+k)*P(n_{min}+k))
$$
$$
n_{avg} = \sum_{k=0}^\infty( (n_{min}+k)*{n_{min}+k-1 \choose n_{min}-1} *p^{n_{min}}*(1-p)^{k} )
$$
Maybe someone else is able to fit the healing into this.