Cubase 8.5 Midi Question

Good day.
I’m using Cubase 8.5. I want to play a single line (melody Line) on one track. I then want to play chords on another separate track. I then want the chords track to be triggered by the melody track so that the chords follow the rhythmic note pattern/sequence of the melody track. Is this possible. Do I need a plugin to do this? Please any help or suggestions welcome. Thanks.