Let us denote by $D$ the set of such integers $d$; we clearly have $D\cap \{m,m+1,\ldots,n\} = \emptyset$.
The given condition $n>m(m-2)$ writes as $n\geq m(m-2)+1 = (m-1)^2$. If the set $\{d\in D \mid d>n\}$ were to be non-empty, consider its minimal element $\delta$, and a prime $p \mid \delta$. Then $\delta/p \in D$, so $\delta/p \leq m-1$, therefore $p\geq \delta/(m-1) > (m-1)^2/(m-1) = m-1$, but clearly the primes dividing any $d\in D$ are of value at most $m-1$, contradiction.
So $\{d\in D \mid d>n\} = \emptyset$, and since obviously $m-1 \in D$, it follows $\max D = m-1$.