If I am not mistaken, Didimo's case was that while descending he switched QNH from standard to actual too early. Indeed, when the altimeter shows slightly less than FL180, it is possible that the actual altitude is higher than 18000ft. If QNH is set in this situation, the displayed altitude will increase over the threshold and the penalty may be applied.
The only (and non-subtle) solution is to set the QNH (while descending) at a significant lower level than FL180.
If flying with the FS ATC, this one provides the QNH setting while first instructing you to descend below FL180. This could be a clue about the difference between the indicated and actual altitudes.
If flying online... well, over Europe this is less of a problem because transition levels are way lower than FL180 so by the time the ATC instructs one do descend below the transition level, one is already out of the "risky" area around 18000ft.
Hope this helps
Andrei