In the following, I assume the set of all feasible solutions is the set $\{(T,uv):T$ is a not necessarily minimum spanning tree of $G$ and $uv$ is a distinguished edge in $T\}$, with the cost of a particular solution $(T,uv)$ being the sum of the edges in $T$ minus $\min(D,w(uv))$.
Let $(T, uv)$ be an optimal solution to the problem you describe, having weight $\sum_{xy \in E(T)} w(xy) - s$, where $s = \min(D, w(uv))$. There are two possibilities:
- Every MST of $G$ contains at least one edge of weight $\ge s$.
- At least one MST of $G$ contains no edge of weight $\ge s$.
Case 1
For case 1, we can take any MST $T'$, find an edge in it with weight at least $s$ (since we know by assumption that this exists), and produce a solution having weight at most $\sum_{xy \in E(T')} w(xy) - s$. This is at most the weight $\sum_{xy \in E(T)} w(xy) - s$ of the optimal solution $(T, uv)$, since $\sum_{xy \in E(T')} w(xy) \le \sum_{ab \in E(T)} w(ab)$ for any tree $T$ by definition of the MST. That means that for case 1, we can never miss an optimal solution by considering only MSTs.
Case 2
For case 2, consider the edge $uv$ in $T$, which has weight at least $s$. Let the vertices on one side of this edge be $A$, and the vertices on the other side $B$. By assumption, there exists an MST in which every edge has weight strictly less than $s$. In particular, this MST must contain an edge $u'v'$ between the vertex sets $A$ and $B$ having weight strictly less than $s$, since otherwise the MST would be disconnected -- a contradiction.
Suppose $w(uv) > D$. Then the original solution $(T, uv)$ has weight $X - D$, with $X$ being the weight of the entire tree $T$, while the solution formed by replacing $uv$ with $u'v'$ has weight $X - w(uv) < X - D$. This contradicts optimality of $(T, uv)$, so it must be that in fact $w(uv) \le D$, in which case both the original and new solutions have weight $X - w(uv)$. Thus the new solution has weight equal to the old solution, but now falls into case 1 above.
Wrapping up
Since there are only two possible cases for an optimal solution, and in both cases an MST can always be found that leads to a solution that is just as good, it always suffices to find an MST.
The final step is to choose an edge in the MST to minimise. Clearly it is always optimal to choose the heaviest edge in the MST.