title: conditionally changing parameter inside ON MATCH SET clause
body: <p>I'm implementing a learning algorithm where the relationship between two nodes is strengthened when they are used together. The cost attribute should be limited to 1, so I want to expand the following query </p>
  
  <pre><code>MATCH (a:Node),(b:Node)
  WHERE a.tag = "tag1" AND b.tag = "tag2"
  MERGE (a)-[r:SIMILAR]-&gt;(b)
  ON CREATE SET r.cost = 0.01*exp(4.60517*0.5)
  ON CREATE SET r.costx = 0.5
  ON MATCH SET r.cost = 0.01*exp(4.60517*(r.costx-0.01))
  ON MATCH SET r.costx = r.costx -0.01 
  RETURN *
  </code></pre>
  
  <p>to something like this, with my goal added in pseudocode</p>
  
  <pre><code>MATCH (a:Node),(b:Node)
  WHERE a.tag = "tag1" AND b.tag = "tag2"
  MERGE (a)-[r:SIMILAR]-&gt;(b)
  ON CREATE SET r.cost = 0.01*exp(4.60517*0.5)
  ON CREATE SET r.costx = 0.5
  if r.cost &lt; 1
      ON MATCH SET r.cost = 0.01*exp(4.60517*(r.costx-0.01))
      ON MATCH SET r.costx = r.costx -0.01 
  RETURN *
  </code></pre>
  
  <p>How to translate the if-clause to Cypher?</p>