How to make a timer countdown live without refresh

I have a timer which countdown for a user to get dispute button on their dashboard.

But the problem is the timer don’t countdown in real time without refreshing the page.

Even if you refresh page it still doesn’t count but rather it shows the remaining time.
How can I make this count in real time.

type here

(function($) {
“use strict”;

        function startTimer(duration, display) {
            let timer = duration;
            let minutes;
            let seconds;
            if (display) {
                setInterval(function() {
                    minutes = parseInt(timer / 60, 10);
                    seconds = parseInt(timer % 60, 10);

                    minutes = minutes < 10 ? "0" + minutes : minutes;
                    seconds = seconds < 10 ? "0" + seconds : seconds;
                    display.textContent = minutes + ":" + seconds;

                    if (--timer < 0) {
                        timer = duration;
                    }
                }, 1000);
            }

        }

        @if ($trade->status == Status::TRADE_ESCROW_FUNDED)
            window.onload = function() {
                let cancelMinutes = 60 * '{{ $remainingMinitues }}';
                let display = document.querySelector('#cancel-min');
                startTimer(cancelMinutes, display);
            };
        @endif

        @if ($trade->status == Status::TRADE_BUYER_SENT)
            window.onload = function() {
                var disputeMinutes = 60 * '{{ $remainingMin }}';
                let display = document.querySelector('#dispute-min');
                startTimer(disputeMinutes, display);
            };
        @endif
    })(jQuery);