Store two values in each stack entry: the value itself and the minimum at that point in history.
When you push, the new minimum is min(val, currentMin). Store both.
When you pop, you lose that entry's value AND its recorded minimum. But the entry below it still has the correct minimum for its state.
Each stack position remembers what the minimum was when it became the top. No need to recalculate.