Add water and salt to a pot, stir to combine, and bring to a boil. Once boiling, add the macaroni and cook for about 1-2 minutes longer than the time indicated on the package instructions.
Drain the macaroni in a colander, making sure to remove as much excess water as possible. While the macaroni is still warm, transfer it to a bowl and toss with rice vinegar. Then, add olive oil and toss to coat. Let the macaroni sit until it cools to room temperature.
Slice the onion very thinly, cut the cucumber into very thin rounds, and cut the ham into bite-sized pieces, about ½-inch (1-1.5 cm) cubes. Sprinkle salt over the onion and cucumber, gently rub them, and let them sit for about 10 minutes.
Squeeze the onion and cucumber by hand to remove any excess moisture.
Once the macaroni has cooled, add the cucumber, onion, ham, Japanese mayonnaise, sugar, salt, and pepper to the bowl, and toss everything together.