title: Is there a way to modify a running countdown?
body: <p>I'm currently creating a game for a game jam organized by my school, using html, css, javascript and jQuery.</p>
  
  <p>In this game, i'm using a countdown (which works fine), but i'd like it to lose 2 seconds when my character is getting hit by enemies. When the countdown reaches 0, the player loses the game.</p>
  
  <p>To do so, I'm using the "jChavannes"' github (<a href="https://github.com/jchavannes/jquery-timer" rel="nofollow">Link here</a>) that is really complete, but I can't find a way to modify the countdown while it's running even though 'jchavannes' put a lot of tools to use his work.</p>
  
  <p>Here is the HTML code of what i'd like to make work, with buttons of what I need to modify the countdown and the javascript of what I'm using to make the whole thing work (one library is missing but it's way too big to be put here, you'll find it in the Github).</p>
  
  <p>Is there a simply way to modify the remaining time, or is it simply not designed to be modified without stopping and resetting it?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var Example2 = new (function() {
      var $countdown,
          $form, // Form used to change the countdown time
          incrementTime = 70,
          currentTime = 30000,
          updateTimer = function() {
              $countdown.html(formatTime(currentTime));
              if (currentTime == 0) {
                  Example2.Timer.stop();
                  timerComplete();
                  Example2.resetCountdown();
                  return;
              }
              currentTime -= incrementTime / 10;
              if (currentTime &lt; 0) currentTime = 0;
          },
          timerComplete = function() {
              alert('Example 2: Countdown timer complete!');
          },
          init = function() {
              $countdown = $('#countdown');
              Example2.Timer = $.timer(updateTimer, incrementTime, true);
              $form = $('#example2form');
              $form.bind('submit', function() {
                  Example2.resetCountdown();
                  return false;
              });
          };
      this.resetCountdown = function() {
          var newTime = parseInt($form.find('input[type=text]').val()) * 100;
          if (newTime &gt; 0) {currentTime = newTime;}
          this.Timer.stop().once();
      };
      $(init);
  });
  //I tried to trigger some commands, in vain
  $("#timerOnce5000").click(function(){
  console.log("euh ouais ?");
  $("#countdown").timer.once(5000);
  });
  $("#timerSetTime1000").click(function(){
      console.log("allô ?");
      $("#countdown").timer.set({time:1000});
  });
  $("#timerSetTime5000").click(function(){
      console.log("bonjour ?");
      $("#countdown").timer.set({time:5000});
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"&gt; 
      &lt;head&gt; 
      &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
      &lt;meta name="author" content="Jason Chavannes" /&gt;
      &lt;title&gt;jQuery Timer Demo&lt;/title&gt;
  
      &lt;link rel="stylesheet" href="res/style.css" /&gt;
      &lt;script type="text/javascript" src="res/jquery.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="jquery.timer.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="res/demo.js"&gt;&lt;/script&gt;
      &lt;/head&gt; 
      &lt;body&gt;
      &lt;h3&gt;Example 2 - Countdown Timer&lt;/h3&gt;
      &lt;span id="countdown"&gt;05:00:00&lt;/span&gt;
      &lt;form id="example2form"&gt;
          &lt;input type='button' value='Play/Pause' onclick='Example2.Timer.toggle();' /&gt;
          &lt;input type='button' value='Stop/Reset' onclick='Example2.resetCountdown();' /&gt;
          &lt;input type='text' name='startTime' value='300' style='width:30px;' /&gt;
      &lt;/form&gt;
  
      &lt;div class='example-four'&gt;
          &lt;input type='button' value='timer.reset()' onclick='timer.reset();' /&gt;&lt;br/&gt;
          &lt;input type='button' value='timer.once()' onclick='timer.once();' /&gt;&lt;br/&gt;
          &lt;input type='button' value='timer.once(5000)' id="timerOnce5000" onclick='timer.once(5000);' /&gt;&lt;br/&gt;
          &lt;input type='button' value='timer.set({time:1000})' id ="timerSetTime1000" onclick='timer.set({time:1000});' /&gt;&lt;br/&gt;
          &lt;input type='button' value='timer.set({time:5000})' id="timerSetTime5000" onclick='timer.set({time:5000});' /&gt;
      &lt;/div&gt;
      &lt;br/&gt;</code></pre>
  </div>
  </div>
  </p>